Why can't i build openCV.cbp in codeblocks?

asked 2017-10-28 03:53:48 -0600

Swagsquad gravatar image

updated 2017-10-28 04:03:28 -0600

berak gravatar image

It shows this error message when i try build it.

-C:\MinGW\bin\windres.exe: supported targets: pe-i386 pei-i386 elf32-i386 elf32-iamcu elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex

-mingw32-make.exe[2]: * [modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj] Error 1

-mingw32-make.exe[1]: * [modules/core/CMakeFiles/opencv_core.dir/all] Error 2

-mingw32-make.exe: * [all] Error 2

-modules\core\CMakeFiles\opencv_core.dir\build.make:1638: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/vs_version.rc.obj' failed

-mingw32-make.exe[2]: Leaving directory 'C:/Program Files (x86)/opencv/MyopenCV'

-CMakeFiles\Makefile2:1640: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed

-mingw32-make.exe[1]: Leaving directory 'C:/Program Files (x86)/opencv/MyopenCV'

-C:/Program Files (x86)/opencv/MyopenCV/Makefile:161: recipe for target 'all' failed

-Process terminated with status 2 (0 minute(s), 7 second(s))

-5 error(s), 0 warning(s) (0 minute(s), 7 second(s))

edit retag flag offensive close merge delete

Comments

this is a known problem , when trying to build opencv libs using mingw

please go back to cmake, disable precompiled headers, clean your build folder,and try again.

berak gravatar imageberak ( 2017-10-28 04:01:59 -0600 )edit

Now i get these errors gcc: error: Files\: No such file or directory

gcc: error: (x86)\opencv\sources\3rdparty\include\ffmpeg_: No such file or directory

C:\MinGW\bin\windres.exe: preprocessing failed.

and further down:

modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:236: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/vs_version.rc.obj' failed

mingw32-make.exe[2]: Leaving directory 'C:/Program Files (x86)/opencv/MyopenCV'

CMakeFiles\Makefile2:2999: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' failed

mingw32-make.exe[1]: Leaving directory 'C:/Program Files (x86)/opencv/MyopenCV'

C:/Program Files (x86)/opencv/MyopenCV/Makefile:161: recipe for target 'all' failed

Swagsquad gravatar imageSwagsquad ( 2017-10-28 07:44:24 -0600 )edit

which mingw is it, exactly ? (you have to use some mingw64, the 32bit version won't do)

did you really clean the build folder before running cmake again ?

add the cmake output to your question (it's long..)

otherwise, no idea.

berak gravatar imageberak ( 2017-10-28 07:48:37 -0600 )edit

I just deleted the folder i called MyopenCV

Swagsquad gravatar imageSwagsquad ( 2017-10-28 07:49:51 -0600 )edit

I had the 32 bit version, and i now have the 64 bit one, but now i get a new error:

gcc: error: Files\: No such file or directory

gcc: error: (x86)\opencv\sources\3rdparty\include\ffmpeg_: No such file or directory C:\PROGRA~1\MINGW-~1\X86_64~1.0-P\mingw64\bin\windres.exe: preprocessing failed.

mingw32-make.exe[2]: * [modules\videoio\CMakeFiles\opencv_videoio.dir\build.make:262: modules/videoio/CMakeFiles/opencv_videoio.dir/vs_version.rc.obj] Error 1

mingw32-make.exe[1]: * [CMakeFiles\Makefile2:3000: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2

mingw32-make.exe: * [C:/Program Files (x86)/opencv/OpenCv/Makefile:162: all] Error 2

Swagsquad gravatar imageSwagsquad ( 2017-10-28 16:09:55 -0600 )edit

i can only guess, but maybe you setup the compiler related things wrong, when running cmake.

try to use cmake-gui, give it the path to mingw32-make.exe, it should infer the other tools from there.

berak gravatar imageberak ( 2017-10-29 03:06:49 -0600 )edit

@Swagsquad: Could you solve the problem ? I am having nearly the same, see http://answers.opencv.org/question/18...

Leo55 gravatar imageLeo55 ( 2018-01-19 05:14:17 -0600 )edit