How i can use OpenCV 3.0.0 on qt in Windows 10 ?

asked 2016-02-05 15:08:38 -0600

saeid_masumi gravatar image

updated 2016-02-06 06:10:30 -0600

Hi,sorry for my simple question but i try to install opencv3 on qt ... I knew that i can't use prebuilt library for qt and i have to build it with mingw compiler(for it i use Cmake) but i test many ways but now i really confused, is there any way i can trust him.i use qt5.4.2

when i build opencv3 in cmnd window this error appear.

Scanning dependencies of target opencv_videoio [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap.cpp.obj [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_images.cpp.obj [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_encoder.cpp.obj [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_mjpeg_decoder.cpp.obj [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_cmu.cpp.obj [ 38%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:122:11: error: base class 'struct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor] interface IEnumPIDMap : public IUnknown ^ C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:122:11: error: 'struct IEnumPIDMap' has virtual functions and accessible non-virtual destructor [-Werror=non-virtual-dtor] C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:139:11: error: base class 'struct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor] interface IMPEG2PIDMap : public IUnknown ^ C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:139:11: error: 'struct IMPEG2PIDMap' has virtual functions and accessible non-virtual destructor [-Werror=non-virtual-dtor] C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:227:11: error: base class 'struct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor] interface ISampleGrabberCB : public IUnknown ^ C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:227:11: error: 'struct ISampleGrabberCB' has virtual functions and accessible non-virtual destructor [-Werror=non-virtual-dtor] C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:239:11: error: base class 'struct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor] interface ISampleGrabber : public IUnknown ^ C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:239:11: error: 'struct ISampleGrabber' has virtual functions and accessible non-virtual destructor [-Werror=non-virtual-dtor] C:\OpenCV\s.3\sources\modules\videoio\src\cap_dshow.cpp:646:7: error: base class 'struct ISampleGrabberCB' has accessible non-virtual destructor [-Werror=non-virtual-dtor] class SampleGrabberCallback : public ISampleGrabberCB{ ^ cc1plus.exe: some warnings being treated as errors modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:187: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj' failed mingw32-make[2]: * [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_dshow.cpp.obj] Error 1 CMakeFiles\Makefile2:4506: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed mingw32-make[1]: [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 makefile:148: recipe for target 'all' failed mingw32-make: ** [all] Error 2

but when i use opencv2.4, Cmake can built my library but when i want to link opencv to qt following error appear.

my error when i use OpenCV 2.4 in below image (picture link) image description

and my ... (more)

edit retag flag offensive close merge delete


"when i use opencv3 cmake can't make file why? " -- how would we know without seeing your errors ?

please append the cmake output to your question

berak gravatar imageberak ( 2016-02-05 23:44:35 -0600 )edit
  • please spare us screenshots, we'd rather like text version of what you did, and the errors.
  • your question title is about opencv3, and now you you mix it all up with 2.4 problems ? please be consise.
berak gravatar imageberak ( 2016-02-06 04:02:55 -0600 )edit

btw, you should not try to link .dll files, but .a (this all looks less and less like an opencv problem, but 'noob does not know, how to use ide'.

berak gravatar imageberak ( 2016-02-06 04:04:49 -0600 )edit

Thanks to answer but i follow this tutorial and there author link .dll files.

saeid_masumi gravatar imagesaeid_masumi ( 2016-02-06 04:30:05 -0600 )edit

do you really expect us to read your (non-working) tutorial ?

berak gravatar imageberak ( 2016-02-06 04:32:42 -0600 )edit

you have to use: -lopencv_core , not -llibopencv_core.dll with mingw (same for the other libs)

berak gravatar imageberak ( 2016-02-06 04:35:14 -0600 )edit

please no screenshots !

berak gravatar imageberak ( 2016-02-06 04:39:25 -0600 )edit

and you can't compile opencv with ipp using mingw32, you will have to look for the "WITH_IPP" option in cmake, and disable that

berak gravatar imageberak ( 2016-02-06 04:40:44 -0600 )edit

I can't file this library:( please tell me lib path

saeid_masumi gravatar imagesaeid_masumi ( 2016-02-06 04:41:35 -0600 )edit

it's by default disable :(

saeid_masumi gravatar imagesaeid_masumi ( 2016-02-06 04:48:03 -0600 )edit