C#中调用C++的dll找不到函数的入口点
我的C++的DLL是这样的
_declspec (dllexport) double add(double * a,double * b)
{
return *a+*b;
}
在C#中是这样调用的:
[DllImport("111.dll")]
public static extern double add(ref double a, ref double b);
private void button1_Click(object sender, EventArgs e)
{
double a= 10.5;
double b= 20.6;
lbResult.Text = add(ref a,ref b).ToString();
}
弹出错误,说找不到Dll中add的入口点,为什么呢?