在 Qt Creator 中使用 FlyCapture SDK

Using FlyCapture SDK with Qt Creator

我使用 Windows 7,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 吗?

问题是我试图用 MinGW 编译项目,而 FlyCapture 库是用 Visual C++ 编译的。

我在Qt Creator里改了编译器,问题解决了