Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Using FlyCapture SDK with Qt Creator
Qt 6.12 LTS is out! See what's new in the release blog

Using FlyCapture SDK with Qt Creator

Scheduled Pinned Locked Moved Solved C++ Gurus
flycaptureqt-creator
3 Posts 2 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gMatos
    wrote on last edited by
    #1

    I am usign Windows 7, Qt Creator 4.4.1 (x32) and FlyCapture SDK 2.11.3.425. The problem is that I keep getting linking errors when trying to use the FlyCapture Library.

    I have boiled down the problem to a simple program. The SDK main path is 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 += -L$$PWD/../../../../../PointGrey/lib/ -lFlyCapture2
    LIBS += C:/PointGrey/bin/FlyCapture2GUI_C_v110.dll
    

    These are the errors:

    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
    

    So, how can I use FlyCapture SDK with Qt creator? Am I missing some .dll? Is FlyCapture only compatible with Visual Studio?

    aha_1980A 1 Reply Last reply
    0
    • G gMatos

      I am usign Windows 7, Qt Creator 4.4.1 (x32) and FlyCapture SDK 2.11.3.425. The problem is that I keep getting linking errors when trying to use the FlyCapture Library.

      I have boiled down the problem to a simple program. The SDK main path is 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 += -L$$PWD/../../../../../PointGrey/lib/ -lFlyCapture2
      LIBS += C:/PointGrey/bin/FlyCapture2GUI_C_v110.dll
      

      These are the errors:

      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
      

      So, how can I use FlyCapture SDK with Qt creator? Am I missing some .dll? Is FlyCapture only compatible with Visual Studio?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      Hi @gMatos,

      First question: Which compiler was used to compile the FlyCapture library? It has to match your compiler, i.e. you cannot mix MinGW and Visual C++.

      LIBS += -L$$PWD/../../../../../PointGrey/lib/ -lFlyCapture2
      
      That line looks good, but please check the path! If the number of `..` is incorrect, the linker will not find the library.
      
      Note that it may be necessary to link against more libraries, not only FlyCapture2.
      
      > ```
      > C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraC1Ev'
      
      Further note: Avoid directories and file names with spaces. That may lead to hard-to-track errors.
      
      > Am I missing some .dll? 
      
      At the link stage, no. At this stage the .lib or .a files are needed. The dll is needed at runtime.
      
      > Is FlyCapture only compatible with Visual Studio?
      As said above, if FlyCapture was compiled with Visual C++, then yes.

      Qt has to stay free or it will die.

      G 1 Reply Last reply
      3
      • aha_1980A aha_1980

        Hi @gMatos,

        First question: Which compiler was used to compile the FlyCapture library? It has to match your compiler, i.e. you cannot mix MinGW and Visual C++.

        LIBS += -L$$PWD/../../../../../PointGrey/lib/ -lFlyCapture2
        
        That line looks good, but please check the path! If the number of `..` is incorrect, the linker will not find the library.
        
        Note that it may be necessary to link against more libraries, not only FlyCapture2.
        
        > ```
        > C:\Users\Gabriel\Desktop\Qt Basic\FlyCaptureApp\main.cpp:8: error: undefined reference to `_imp___ZN11FlyCapture26CameraC1Ev'
        
        Further note: Avoid directories and file names with spaces. That may lead to hard-to-track errors.
        
        > Am I missing some .dll? 
        
        At the link stage, no. At this stage the .lib or .a files are needed. The dll is needed at runtime.
        
        > Is FlyCapture only compatible with Visual Studio?
        As said above, if FlyCapture was compiled with Visual C++, then yes.
        G Offline
        G Offline
        gMatos
        wrote on last edited by
        #3

        @aha_1980, thank you for your answer!

        This was indeed the problem. The library was compiled with Visual C++.
        I changed the compiler in Qt Creator and the problem was solved!

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved