OpenCV 3.0 fails to build with the following error:
[100%] Generating pyopencv_generated_include.h, pyopencv_generated_funcs.h, pyopencv_generated_types.h, pyopencv_generated_type_reg.h, pyopencv_generated_ns_reg.h
cd /c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python2 && /c/Python27/python.exe /c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python/python2/..//src2/gen2.py /c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python2 /c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python2/headers.txt
Traceback (most recent call last):
File "C:/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python/python2/..//src2/gen2.py", line 940, in <module>
generator.gen(srcfiles, dstdir)
File "C:/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/python/python2/..//src2/gen2.py", line 865, in gen
decls = self.parser.parse(hdr)
File "C:\prj\videoLib\.build\MINGW32_NT-10.0-WOW\i386\opencv\modules\python\src2\hdr_parser.py", line 746, in parse
f = io.open(hname, 'rt', encoding='utf-8')
IOError: [Errno 2] No such file or directory: '/c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv/modules/core/include/opencv2/core.hpp'
modules/python2/CMakeFiles/opencv_python2.dir/build.make:146: recipe for target 'modules/python2/pyopencv_generated_include.h' failed
The file in question (core.hpp) is present in the location being looked at, but I'd guess the problem is that the paths are provided to Python in mingw, rather than standard Windows form.
Is there a way to build OpenCV under mingw? Seems to work just fine, as long as Python bindings aren't required -- but when those are needed things go downhill fast.
The final config status reported by cmake looks like this
-- General configuration for OpenCV 3.0.0 =====================================
-- Version control: 3.0.0-dirty
--
-- Platform:
-- Host: MINGW32_NT-10.0-WOW 2.4.0(0.292/5/3) unknown
-- CMake: 3.2.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make.exe
-- Configuration: Release
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /mingw32/bin/c++.exe (ver 5.2.0)
-- C++ flags (Release): -m32 -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -m32 -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /mingw32/bin/gcc.exe
-- C flags (Release): -m32 -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -O2 -DNDEBUG -DNDEBUG
-- C flags (Debug): -m32 -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -march=i686 -fomit-frame-pointer -msse -msse2 -mfpmath=sse -ffunction-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -static-libgcc -static-libstdc++ -t
-- Linker flags (Debug): -static-libgcc -static-libstdc++ -t
-- Precompiled headers: NO
-- Extra dependencies:
-- 3rdparty dependencies: zlib libjpeg libwebp libpng libtiff
--
-- OpenCV modules:
-- To be built: hal core flann imgproc ml photo video imgcodecs shape videoio highgui objdetect superres ts features2d calib3d stitching videostab python2
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python3 viz
--
-- GUI:
-- QT: NO
-- GTK+: NO
-- GThread : NO
-- GtkGlExt: NO
-- OpenGL support: NO
-- VTK support: NO
--
-- Media I/O:
-- ZLib: zlib (ver 1.2.8)
-- JPEG: build (ver 90)
-- WEBP: build (ver 0.3.1)
-- PNG: build (ver 1.5.12)
-- TIFF: build (ver 42 - 4.0.2)
-- JPEG 2000: NO
-- OpenEXR: NO
-- GDAL: NO
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: NO
-- codec: NO
-- format: NO
-- util: NO
-- swscale: NO
-- resample: NO
-- gentoo-style: NO
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- OpenNI2: NO
-- PvAPI: NO
-- GigEVisionSDK: NO
-- XIMEA: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use IPP Async: NO
-- Use Eigen: NO
-- Use TBB: NO
-- Use OpenMP: NO
-- Use GCD NO
-- Use Concurrency NO
-- Use C=: NO
-- Use pthreads for parallel for:
-- NO
-- Use Cuda: NO
-- Use OpenCL: NO
--
-- Python 2:
-- Interpreter: /c/Python27/python.exe (ver 2.7.9)
-- Libraries: /c/Python27/libs/libpython27.a (ver 2.7.9+)
-- numpy: C /prj/numpyWin/numpy/core/include (ver 1.8.1)
-- packages path: lib/python2.7/site-packages
--
-- Python 3:
-- Interpreter: NO
--
-- Python (for build): /c/Python27/python.exe
--
-- Java:
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
--
-- Matlab:
-- mex: NO
--
-- Tests and samples:
-- Tests: NO
-- Performance tests: NO
-- C/C++ Examples: NO
--
-- Install path: /c/prj/videoLib/INSTALL/i386-w64-mingw32
--
-- cvconfig.h is in: /c/prj/videoLib/.build/MINGW32_NT-10.0-WOW/i386/opencv
-- -----------------------------------------------------------------
--