Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opencv_highgui seems that it can't find qt libs.
Forum Update on Monday, May 27th 2025

Opencv_highgui seems that it can't find qt libs.

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 1.6k 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.
  • A Offline
    A Offline
    Aaron Kim
    wrote on last edited by Aaron Kim
    #1

    While the opencv_highgui was being built during building of the OpenCV (the lastest version in the github), the following undefined errors occurred.

    [ 40%] Linking CXX shared library ..\..\bin\libopencv_highgui400.dll
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN10CvWinModelD1Ev[_ZN10CvWinModelD1Ev]+0x17): undefined reference to `__imp__ZN7QWidgetD2Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN10CvWinModelD0Ev[_ZN10CvWinModelD0Ev]+0x1e): undefined reference to `__imp__ZN7QWidgetD2Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$__tcf_2+0xa): undefined reference to `__imp__ZN6QMutexD1Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$__tcf_1+0xa): undefined reference to `__imp__ZN14QWaitConditionD1Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZL16icvFindBarByNameP10QBoxLayout7QString7typeBar.constprop.204+0x37): undefined reference to `__imp__ZeqRK7QStringS1_'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZThn16_N10CvWinModelD1Ev[_ZThn16_N10CvWinModelD1Ev]+0x1c): undefined reference to `__imp__ZN7QWidgetD2Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZThn16_N10CvWinModelD0Ev[_ZThn16_N10CvWinModelD0Ev]+0x22): undefined reference to `__imp__ZN7QWidgetD2Ev'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0x11): undefined reference to `__imp__ZNK20QFutureInterfaceBase10isCanceledEv'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0x42): undefined reference to `__imp__ZNK20QFutureInterfaceBase5mutexEv'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0x60): undefined reference to `__imp__ZN6QMutex4lockEv'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0x6f): undefined reference to `__imp__ZNK20QFutureInterfaceBase10queryStateENS_5StateE'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0x83): undefined reference to `__imp__ZN20QFutureInterfaceBase14reportFinishedEv'
    CMakeFiles\opencv_highgui.dir/objects.a(window_QT.cpp.obj):window_QT.cpp:(.text$_ZN12QtConcurrent15RunFunctionTaskIiE3runEv[_ZN12QtConcurrent15RunFunctionTaskIiE3runEv]+0xa8): undefined reference to `__imp__ZN20QFutureInterfaceBase15resultStoreBaseEv'
    
    ... (it is very long)
    

    It seems that all the Qt libs were not linked.
    0_1541776475818_h24qwedq.PNG
    But I checked that I specified all the paths correctly.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are you using the same compiler ?
      If not, which one ?
      Are you building for the same architecture ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Aaron Kim
        wrote on last edited by
        #3

        I used the same MinGW and Windows 10.

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          This error clearly indicates either required library is not found in the path or mismatch in the compiler used for opencv compilation and qt compilation. Just check whether debug or release version issue.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          A 1 Reply Last reply
          0
          • A Offline
            A Offline
            Aaron Kim
            wrote on last edited by
            #5
            This post is deleted!
            1 Reply Last reply
            0
            • dheerendraD dheerendra

              This error clearly indicates either required library is not found in the path or mismatch in the compiler used for opencv compilation and qt compilation. Just check whether debug or release version issue.

              A Offline
              A Offline
              Aaron Kim
              wrote on last edited by
              #6

              @dheerendra How can I check what path is being used to find those Qt libraries?

              1 Reply Last reply
              0
              • dheerendraD Offline
                dheerendraD Offline
                dheerendra
                Qt Champions 2022
                wrote on last edited by
                #7

                Not sure how to look at opencv side. Right now you are using the Qt 5.11.x. By any chance is opencv expecting old Qt libraries ?

                Dheerendra
                @Community Service
                Certified Qt Specialist
                http://www.pthinks.com

                A 1 Reply Last reply
                0
                • dheerendraD dheerendra

                  Not sure how to look at opencv side. Right now you are using the Qt 5.11.x. By any chance is opencv expecting old Qt libraries ?

                  A Offline
                  A Offline
                  Aaron Kim
                  wrote on last edited by
                  #8

                  @dheerendra Maybe not.. because this problem occurred with the latest OpenCV version. (4.0.0) The one which I had used before (3.2.0) was built successfully without any error.
                  Then I have to ask this problem to OpenCV forum

                  1 Reply Last reply
                  0
                  • dheerendraD Offline
                    dheerendraD Offline
                    dheerendra
                    Qt Champions 2022
                    wrote on last edited by
                    #9

                    I think we are in same thoughts. It worked with 3.2.0 version. Now it is not working with 4.0.0. Some compatibility issue exist the libraries. As rightly said good check in OpenCV forum as well.

                    Dheerendra
                    @Community Service
                    Certified Qt Specialist
                    http://www.pthinks.com

                    1 Reply Last reply
                    0

                    • Login

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