我正在使用Windows7,Qt Creator 4.4.1 (x32)和FlyCapture SDK 2.11.3.425。问题是,当我尝试使用FlyCapture库时,我一直收到链接错误。
我已把这个问题归结为一个简单的程序。SDK主路径为C:/PointGrey
main.cpp
#include <FlyCapture2.h>
using namespace FlyCapture2;
int main()
{
Camera camera;
return 0;
}FlyCaptureApp.pro
SOURCES += main.cpp
INCLUDEPATH += C:\PointGrey\include
LIBS += C:\PointGrey\bin\FlyCapture2.dll以下是错误:
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraC1Ev'
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraD1Ev'
C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraD1Ev'
collect2.exe:-1: error: error: ld returned 1 exit status我曾尝试导入位于/bin中的.lib文件,但没有成功。
那么,如何在Qt creator中使用FlyCapture SDK呢?我是不是遗漏了一些.dll?FlyCapture只与Visual Studio兼容吗?
发布于 2017-12-22 23:55:37
问题是我试图用MinGW编译项目,而FlyCapture库是用Visual C++编译的。
我在Qt Creator中更改了编译器,问题就解决了。
https://stackoverflow.com/questions/47934768
复制相似问题