简体   繁体   English

MinGW,链接到Windows上的DLL

[英]MinGW, linking to a dll on Windows

I'm trying to use a library I received from a camera vendor in a sample program. 我正在尝试在示例程序中使用我从相机供应商处收到的库。 I have a .dll and a .lib file for the library. 我有一个.dll文件和.lib文件。 My compile command is: 我的编译命令是:

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

and I get: 我得到:

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

having a look on the .lib with nm shows: 看看带有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

and for the dll it outputs: 并为它输出的DLL:

nm: SK91GigE_x64.dll: File format not recognized

Any ideas how I can modify that lib to include it? 任何想法我如何修改该lib以包含它?

windows path variable pointed to 32 bit MinGW. windows path变量指向32位MinGW。 setting the path to the 64bit version of MinGW solved the problem. 设置Minbit的64位版本的路径解决了这个问题。 I didn't check that 我没有检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM