OpenCV 3.2.0 installation error with Cmake and CodeLite IDE

asked 2017-12-30 23:52:25 -0600

nsssayom gravatar image

updated 2017-12-31 05:26:47 -0600

I am trying to build OpenCV binaries for MinGW with CodeLite IDE in Windows 10. I followed the following steps:

  1. Downloaded OpenCV 3.2.0 self-extracting archive from the official website. And extracted in C:/opencv
  2. Downloaded and installed MinGW 6.3.0 (ensured by running command gcc --version
  3. Have installed CodeLite IDE and MinGW was configured as compiler (ensured by running C++ test programs)
  4. Downloaded and installed Cmake3.10.1. Launched Cmake-gui and tried to build the binaries into D:/opencv/build/MinGW. Clicked on configure. Specified CodeLite - MinGW Makefile as the generator of the project. After sometimes I get an error saying Error in configuration process, project files may be invalid

    1. Again clicked on Configure this time no error message was there. Clicked Generate. A CodeLite Workspace was generated in target directory D:\opencv\build\MinGW

    2. Opened that Workspace with CodeLite IDE. Started to build the project. And at 62% it showed error messages and stopped building.

    [ 60%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/blobdetector.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/dynamic.cpp.obj [ 61%] Built target opencv_annotation [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/fast_score.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/fast.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/evaluation.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/gftt.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/feature2d.cpp.obj [ 61%] Built target opencv_visualisation mingw32-make.exe[1]: * [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2 mingw32-make.exe[1]: Waiting for unfinished jobs.... CMakeFiles\Makefile2:5379: recipe for target 'modules/ts/CMakeFiles/opencv_ts.dir/all' failed [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/kaze.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/kaze/AKAZEFeatures.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/kaze/KAZEFeatures.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/kaze/fed.cpp.obj [ 61%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/kaze/nldiffusion_functions.cpp.obj [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/keypoint.cpp.obj [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/main.cpp.obj mingw32-make.exe[1]: [modules/objdetect/CMakeFiles/opencv_objdetect.dir/all] Error 2 CMakeFiles\Makefile2:4649: recipe for target 'modules/objdetect/CMakeFiles/opencv_objdetect.dir/all' failed [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/mser.cpp.obj [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/matchers.cpp.obj [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/src/orb.cpp.obj [ 62%] Building CXX object modules/features2d/CMakeFiles/opencv_features2d.dir/opencl_kernels_features2d.cpp.obj [ 62%] Linking CXX shared library ....\bin\libopencv_features2d320.dll mingw32-make.exe: * [all] Error 2 [ 62%] Built target opencv_features2d Makefile:161: recipe for target 'all' failed ====1 errors, 11 warnings, total time: 00:04:05 seconds====

I also tried the solution proposed in ... (more)

edit retag flag offensive close merge delete

Comments

  • i removed the (useless) screenshots. unfortunately, your make output does not show the actual error, this must be some lines above of what you show here. can you try again ?
  • please get latest 3.4 src from https://github.com/opencv/opencv , not 3.2, also downloading binaries from SF is useless, if you need to build from src for mingw.
  • which mingw is it, exactly ? if gcc --version really returned 3.2.0, it's far too old, to be useful.
  • you have to disable the "precompiled headers" option in cmake
  • since the error seeems to happen in the objdetect module, is it this one ?
  • use the "format as code" ("10101") button to highlight it, not the "quote" one, for better readability.
berak gravatar imageberak ( 2017-12-31 03:35:15 -0600 )edit

Why do you choose opencv 3.2.0 and not opencv 3.4.0?

LBerger gravatar imageLBerger ( 2017-12-31 03:46:11 -0600 )edit

Because I did my codes in OpenCV 3.2.0

nsssayom gravatar imagensssayom ( 2017-12-31 05:06:27 -0600 )edit

@nsssayom, again, can you try to find the real error message ? your make output does not show anything useful, it must be some lines above. also, maybe use make -j1 , to build in a single thread, and get a less cluttered output.

berak gravatar imageberak ( 2017-12-31 05:36:00 -0600 )edit

@berak, I am building again. And will give you the full output msg as soon as I get that.

nsssayom gravatar imagensssayom ( 2017-12-31 05:46:47 -0600 )edit

@berak, I downloaded the source of OpenCV 3.4 from the gitHub link you provided. Then used Cmake-gui with CodeLite-MinGW makefile. Got the same Error in configuration process, project files may be invalid msg. Clicked configure again and then Generate. Opened the project with CodeLite. Start building and got this output.

nsssayom gravatar imagensssayom ( 2017-12-31 05:58:11 -0600 )edit

@berak, can you please tell me how to disable the "precompiled headers" option in cmake-gui?

nsssayom gravatar imagensssayom ( 2017-12-31 06:00:25 -0600 )edit

please disable precompiled headers in cmake, clean your build folder, and try again.

(type "precompiled headers" into the search box)

this should solve the windres elated error.

berak gravatar imageberak ( 2017-12-31 06:00:38 -0600 )edit

@berak, Now I am getting this error

nsssayom gravatar imagensssayom ( 2017-12-31 06:24:01 -0600 )edit

hmm. i'm a little lost now. using mingw64 4.8.1 even, and it builds fine for me. what does:

 std::cout << __cplusplus << std::endl;

yield ?

(there might be something broken with detecting c++11 support with mingw)

berak gravatar imageberak ( 2017-12-31 06:56:22 -0600 )edit