MinGW,链接到Windows上的DLL

时间:2014-12-11 10:53:01

标签: c++ windows gcc dll mingw

我试图在示例程序中使用我从相机供应商处收到的库。我有一个.dll文件和.lib文件。我的编译命令是:

g++  -o "Win32App.exe" -L"..\..\SK develop\SK91GigE-WIN\Lib" obj/winmain.o obj/callbacks.o obj/resource.o -s -lcomctl32 -Wl,--subsystem,windows -lSK91GigE_x64

我得到了:

obj/winmain.o:winmain.cpp:(.text+0x292): undefined reference to `SK_LOADDLL'
collect2.exe: error: ld returned 1 exit status

查看带有nm的.lib显示:

BFD: SK91GigE_x64.lib(SK91GigE_x64.dll): Recognised but unhandled machine type (0x8664) in Import Library Format archive 
nm: SK91GigE_x64.dll: File format not recognized

并输出dll:

nm: SK91GigE_x64.dll: File format not recognized

我是如何修改lib以包含它的?

1 个答案:

答案 0 :(得分:4)

windows path变量指向32位MinGW。设置Minbit的64位版本的路径解决了这个问题。我没有检查