BCB 调用VC++ dll的问题
初次使用BCB,按照网络上丰富的资源,采用静态调用的方式,如下:
dll名:Mydll.dll
dll内函数:void Myfunc()
1、使用implib得到Mydll.lib;
2、使用impdef得到Mydll.def;
3、h文件中加入引用:extern "C" __declspec(dllimport) _stdcall void Myfunc();
4、Button1Click事件中如下使用:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Myfunc();
}
报错:
[Linker Error] Unresolved external 'Myfunc' referenced from D:\我的文档\桌面\BORLAND C++\UNIT1.OBJ
除了报错,还有对dll中其它函数的警告,如下:
[Linker Warning] Attempt to export non-public symbol 'Myfunc2'
[Linker Warning] Attempt to export non-public symbol 'Myfunc3'
……