Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV 3.0 videoio error

Tags:

c++

opencv

qt

I tried to compile OpenCV 3.0 alpha library for Qt Creator 5.4 with CMake 3.1.0, but I have error:

[ 44%] Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap
_dshow.cpp.obj
D:\opencv\sources\modules\videoio\src\cap_dshow.cpp:122:11: error: base class 's
truct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor]

 interface IEnumPIDMap : public IUnknown
           ^
D:\opencv\sources\modules\videoio\src\cap_dshow.cpp:141:11: error: base class 's
truct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor]

 interface IMPEG2PIDMap : public IUnknown
           ^
D:\opencv\sources\modules\videoio\src\cap_dshow.cpp:231:11: error: base class 's
truct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor]

 interface ISampleGrabberCB : public IUnknown
           ^
D:\opencv\sources\modules\videoio\src\cap_dshow.cpp:245:11: error: base class 's
truct IUnknown' has accessible non-virtual destructor [-Werror=non-virtual-dtor]

 interface ISampleGrabber : public IUnknown
           ^
cc1plus.exe: some warnings being treated as errors
modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:150: 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_dsho
w.cpp.obj] Error 1
CMakeFiles\Makefile2:2719: recipe for target 'modules/videoio/CMakeFiles/opencv_
videoio.dir/all' failed
mingw32-make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2

makefile:136: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I selected:

CMAKE --> CMAKE_BUILD_TYPE = Debug
WITH --> WITH_EIGEN = 0
WITH --> WITH_OPENGL = 0
WITH --> WITH_IPP = 0

The rest of settings is default. My OS is Windows 7 64 bit. OpenCV library source: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0-alpha/

What is wrong? Any ideas?

like image 437
spy02 Avatar asked Jan 07 '15 21:01

spy02


1 Answers

I just ran into the same issue when compiling opencv3.0.0 on windows with mingw. I found a solutions following this link.

Go in the repository where opencv sources are located.

For me it was "C:/opencv/sources/".

Go to the "Cmake/" folder and search for the file named "OpenCVCompilerOptions.cmake"

You just comment the line :

add_extra_compiler_option(-Werror=non-virtual-dtor)

So it should become

#add_extra_compiler_option(-Werror=non-virtual-dtor)

Now, you're good to configure and generate the makefile with cmake, the mingw32-make command line should work fine.

like image 171
Neimsz Avatar answered Sep 20 '22 18:09

Neimsz