OpenCV2.4.6 with Qt5.1.0 - clashing JPEG versions

asked 2013-10-30 15:51:36 -0500

BDVS gravatar image

updated 2013-10-31 11:33:42 -0500

I am seeking to use OpenCV2.4.6 with Qt5.1.0 in a statically built application. Qt seems to need JPEG version 8.0 libraries and OpenCV2.4.6 needs JPEG version 6.2.

Can OpenCV2.4.6 be made to work with JPEG version 8.0 libraries - does the call version need to match the library version?

Update: I'm thinking it may be link order...the code using OpenCV is first built into a (static) library...which presumably pulls in OpenCV's JPEG at link time. This library is then linked into the main app which uses Qt call to read a JPEG file. It's as though Qt uses the (clashing version) of OpenCV's JPEG rather than it's own. Everything appears to build cleanly.

Library build: g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I....\ToolkitNonThreaded\TVR -I"....\ToolkitNonThreaded\Core" -I"............\PInstalls\OpenCV2.4.6\opencv\release\install\include" -I"C:\Qt\Qt5.1.0\Tools" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtWidgets" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtGui" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtCore" -I"release" -I"." -I"C:\Qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\mkspecs\win32-g++" -o release\Steps.o ....\ToolkitNonThreaded\TVR\Steps.cpp

ar -ru release\libTVR.a release/TVRAnalyse.o release/ProcessingStep.o release/Steps.o release/VehicleClass.o release/moc_TVRAnalyse.o release/moc_ProcessingStep.o

Final build: g++ -static -static-libgcc -Wl,-s -Wl,-subsystem,windows -mthreads -o release\Toolkit.exe object_script.Toolkit.Release -lmingw32 -lqtmain -L../pipslib/release -L../winpcap-lib -L../qtsingleapplication/release -lpips ..\winpcap-lib\wpcap.lib ..\winpcap-lib\Packet.lib -lIPHlpApi -lWs2_32 -LC:/qt/Qt5.1.0/qt-everywhere-opensource-src-5.1.0/qtbase/lib -lwpcap -lpacket -lqtsingleapplication -L../TVR/release -lTVR -LF:/PInstalls/OpenCV2.4.6/opencv/release/install/lib -lopencv_video246 -lopencv_calib3d246 -lopencv_features2d246 -lopencv_flann246 -lopencv_imgproc246 -lopencv_highgui246 -lopencv_legacy246 -lopencv_core246 -LC:/Qt/Qt5.1.0/Tools/OpenCV2.4.6/opencv/release/3rdparty/lib -lIlmImf -llibjasper -llibjpeg -llibpng -llibtiff -lzlib -LC:/Qt/Qt5.1.0/Tools/mingw48_32/i686-w64-mingw32/lib -lQt5XmlPatterns -lQt5Widgets -lQt5Xml -lQt5Network -ldnsapi -LC:/Qt/Qt5.1.0/qt-everywhere-opensource-src-5.1.0/qtbase/plugins/platforms -lqwindows -lwinspool -lshlwapi -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz release\Toolkit_res.o

Runtime Qt error: Wrong JPEG library version: library is 62, caller expects 80

If I use a non-statically built Qt and the same source, with dll's all works fine.

edit retag flag offensive close merge delete


I tried openCV2.4.5 and Qt5.1.1 on my windows7, it works perfectly.Please show us your codes and try your best to make the codes short and clean.

stereomatching gravatar imagestereomatching ( 2013-10-30 22:02:51 -0500 )edit