我将g ++编译的测试客户端与使用Visual Studio 2008编译的dll链接。它会生成以下错误消息。
client2.o:client2.c:(.text+0x11): undefined reference to `ICD_Create(char*)@4'
client2.o:client2.c:(.text+0x3e): undefined reference to `ICD_Remove()@0'
client2.o:client2.c:(.text+0x88): undefined reference to `ICD_Open(unsigned int, unsigned int, char, unsigned int, unsigned int)@20'
client2.o:client2.c:(.text+0xae): undefined reference to `ICD_Close()@0'
client2.o:client2.c:(.text+0xf7): undefined reference to `ICD_Command(char const*)@4'
client2.o:client2.c:(.text+0x11d): undefined reference to `ICD_Synchronize()@0'
collect2: ld returned 1 exit status
g ++和visual studio库之间是否存在冲突?我使用错误的DLL接口吗?
更新
g ++命令是g ++ -o client2.out client2.0 i-cut_driver.dll
答案 0 :(得分:0)
通常,使用不同C ++编译器生成的C ++代码与链路不兼容。用g++
和VisualStudio构建的C ++代码几乎肯定不是。