关于 dll 无法找到入口的问题
在c++中
extern "C" _declspec(dllexport) int Max(int a, int b);
//MyDll.cpp
class _declspec(dllexport) class1{
public:
int Max(int a, int b) //此函数即为 想在c#中调用的函数
{
if(a>=b)
return a;
else
return b;
}
};
在c#中进行调用
class Program
{
[DllImport("11.dll", EntryPoint = "Max")]
public static extern int Max(int a, int b);
static void Main(string[] args)
{
int max;
max = Program.Max(3,6);
Console.Write(max);
}
}
问题陈述:
在c++中有个类class1 中有个Max函数,在c#中调用此Max函数,结果提示无法从dll找到入口@!
请问 此问题如何解决
谢谢指点@!在线等