I am trying to create an example of exporting a simple function from a managed C# class library and use it in an unmanaged C++ console application.
I'm using Robert Giesecke's Unmanaged Exports for this. (IDE is Visiual Studio 2017)
My Code on the managed side of things is:
using RGiesecke.DllExport;
using System.Runtime.InteropServices;
namespace ManagedCodeDll
{
public class Calculator
{
[DllExport(CallingConvention = CallingConvention.Cdecl)]
static public int Add(int a, int b)
{
return a + b;
}
}
}
The Build Platform target is set to x86.
But when building the project no .lib file is created. Only the dll itself.
From what I understand is that I need the lib file for the linker setting on the unmanaged side.
What am I doing wrong? Can someone help me?