Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Using FlyCapture SDK with Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Using FlyCapture SDK with Qt Creator

Scheduled Pinned Locked Moved Solved C++ Gurus
flycaptureqt-creator
3 Posts 2 Posters 2.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 22 Dec 2017, 13:41 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?

    A 1 Reply Last reply 22 Dec 2017, 14:28
    0
    • G gMatos
      22 Dec 2017, 13:41

      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?

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 22 Dec 2017, 14:28 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 22 Dec 2017, 15:37
      3
      • A aha_1980
        22 Dec 2017, 14:28

        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 22 Dec 2017, 15:37 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

        1/3

        22 Dec 2017, 13:41

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved