代码之家  ›  专栏  ›  技术社区  ›  GMatos

将FlyCapture SDK与Qt Creator配合使用

  •  1
  • GMatos  · 技术社区  · 7 年前

    我使用Windows 7、Qt Creator 4.4.1(x32)和FlyCapture SDK 2.11.3.425。问题是,在尝试使用FlyCapture库时,我不断遇到链接错误。

    我已把这个问题归结为一个简单的程序。SDK主路径为C:/PointGrey

    主要的cpp公司

    #include <FlyCapture2.h>
    using namespace FlyCapture2;
    int main()
    {
        Camera camera;
        return 0;
    }
    

    FlyCaptureApp。赞成的意见

    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
    

    我已尝试导入。lib文件位于/bin中,但未成功。

    那么,如何将FlyCapture SDK与Qt creator结合使用呢?我错过了一些吗。dll?FlyCapture是否仅与Visual Studio兼容?

    1 回复  |  直到 7 年前
        1
  •  2
  •   GMatos    7 年前

    问题是我试图用MinGW编译这个项目,而FlyCapture库是用visualc++编译的。

    我在Qt Creator中更改了编译器,问题就解决了。