Problem with building OpenCV with Cmake in Windows
System information (version)
- OpenCV => 3.4.2 (clone the latest)
- Operating System / Platform => Windows 10 64-Bit
- Compiler => gcc 7.2.0 (minGW 5.3.0)
Configuring and generating with CMake works fine, but when I execute mingw32-make in the folder, it stops and shows the error message below.
[ 36%] Linking CXX shared library ..\..\bin\libopencv_core400.dll
CMakeFiles\opencv_core.dir/objects.a: member CMakeFiles\opencv_core.dir/objects.a(vs_version.rc.obj) in archive is not an object
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1433: bin/libopencv_core400.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:1694: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
mingw32-make: *** [Makefile:162: all] Error 2
I can't find other issue which shows the same symptom, or at least a clue to solve this. I tried this tutorial either, but the same error occurs.
[+EDIT]
The line that causes error is below.
cd /d D:\opencv-build\modules\core && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\opencv_core.dir\link.txt --verbose=$(VERBOSE)
And I manually tried the command below in modules\core folder and it shows the same error.
cmake -E cmake_link_script CMakeFiles\opencv_core.dir\link.txt
[+EDIT2]
I successfully built it using OpenCV 3.2.0. I checked that 3.3.0 >= shows the error above.
try again with:
(and a clean build folder)
@berak Still shows the same error.
no idea, what's wrong on your side, but i can build 3.4.2 successfully using mingw 7.2 here.
It seems that this guy had the same problem with me.. but ended up getting no solution. Maybe I just have to use 3.2.0 version
no, you have to win the fight against cmake.
objects.a is the key. I searched it and found that someone said that toolchain can not recognize the format. But I think that it is not the problem related to my MinGW because I also tried building it using not only MinGW downloaded in Google, but also other MinGWs bundled with Qt, and TDM-GCC
I have the exact same issue with exact same error message!! Any suggestion yet, pls?!!
No solution for this?
in cmake gui add entry OPENCV_VS_VERSIONINFO_SKIP = 1. It worked for me.