Opencv_highgui seems that it can't find qt libs.
-
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.
But I checked that I specified all the paths correctly. -
Hi,
Are you using the same compiler ?
If not, which one ?
Are you building for the same architecture ? -
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.
-
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 How can I check what path is being used to find those Qt libraries?
-
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 ?
-
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 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 -
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.