My Ubuntu computer installed both qt4 and qt5 because of the compatibility with some libs. Currently, I want to rebuild opencv with qt4 (for highgui). But cmake always uses qt5 (default version). I edited CMakeLists.txt
find_package(Qt4 COMPONENTS QTCORE QTGUI)
// I remove HAVE_QT5 variable
if(HAVE_QT)
status(" QT 4.x:" HAVE_QT THEN "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})" ELSE NO)
status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO)
else()
...................
After I rebuilt opencv, I check dependencies using ldd libopencv_highgui.so
libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f4e5245a000) libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f4e51e0d000) libQt5Widgets.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007f4e515e4000) libQt5Test.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Test.so.5 (0x00007f4e513bb000) libQt5OpenGL.so.5 => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5 (0x00007f4e51157000)
Highgui still link to Qt5. Can anybody help me ? Thanks !
cmake -LA
. – ypnos