Cannot compile OpenCV 3.0
Hello,
I downloaded OpenCV 3.0 from this website, and after the cmake step, I obtain an an error during the make step, here it is:
Linking CXX shared library ....\bin\libopencv_core300.dll c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lRunTmChk collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1257: recipe for target 'bin/libopencv_core300.dll' failed mingw32-make[2]: * [bin/libopencv_core300.dll] Error 1 CMakeFiles\Makefile2:1325: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make[1]: [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:136: recipe for target 'all' failed mingw32-make: ** [all] Error 2
I'm under Windows7 64bits, and using mingw32 4.8.1
I have no idea of what is -lRunTmChk, so any help would be greatful...
Also, I have to add that I can compile OpenCV 2.4.9 without any problem.
Any suggestion?
I have the same problem. I'm running Windows7 32 bits.
First i get the following warning:
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.obj C:\opencv3alfa\opencv\sources\modules\core\src\system.cpp: In function 'BOOL cv::DllMain(HINSTANCE, DWORD, LPVOID)': C:\opencv3alfa\opencv\sources\modules\core\src\system.cpp:918:13: warning: no previous declaration for 'BOOL cv::DllMain(HINSTANCE, DWORD, L PVOID)' [-Wmissing-declarations] BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved) ^
then:
[ 31%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/tables.cpp.obj [ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/types.cpp.obj
[ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/umatrix.cpp.obj [ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/opencl_kernels_core.cpp.obj Linking CXX shared library ....\bin\libopencv_core300.dll c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lRunTmChk collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1260: recipe for target 'bin/libopencv_core300.dll' failed mingw32-make[2]: * [bin/libopencv_core300.dll] Error 1 CMakeFiles\Makefile2:1334: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed mingw32-make[1]: * [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:135: recipe for target 'all' failed
mingw32-make: * [all] Error 2
RunTmChk is a msvc library erroneously linked to your mingw compiled library.
it'skinda a 'known bug' related to the ipp addition, - as long as the error prevails, you can't use IPP with mingw.
you could try to rerun cmake -DWITH_IPP=OFF (disable it)
Hello Guys,
I am getting same issue while building Intel's IPP and TBB with Opencv3.0 using Mingw on Windows machine. Here is the error screenshot and details. [https://software.intel.com/en-us/foru...] Kindly open this url to find more detail about this issue. Kindly, Let me know what steps should I take to remove this issue from root and I already tried below answers.
Thank you
@tushar, you have to disable IPP if using mingw32.
cmake -DWITH_IPP=OFF
(also, much better, if you ask your question here)
Hello
Thank you very much for quick response. I already tried it but,did not get success. Even, I tried to compile TBB alone with opencv though it was throwing same error.
C:\opencv\sources\modules\core\src\system.cpp: In function 'BOOL cv::DllMain(HIN STANCE, DWORD, LPVOID)': C:\opencv\sources\modules\core\src\system.cpp:918:13: warning: no previous decla ration for 'BOOL cv::DllMain(HINSTANCE, DWORD, LPVOID)' [-Wmissing-declarations]
BOOL WINAPI DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpReserved) ^ [ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/tables.cp p.obj [ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/types.cpp .obj [ 32%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/umatrix.c pp.obj [ 33%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/opencl_kernel s_core.cpp.obj Linking CXX shared library ....\bin\libopencv_core300.dll
CMakeFiles\opencv_core.dir/objects.a(parallel.cpp.obj):parallel.cpp:(.text$_ZN3t bb10interface78internal9start_forINS_13blocked_rangeIiEEN12_GLOBAL__N_113ProxyLo opBodyEKNS_16auto_partitionerEED2Ev+0x2): undefined reference to
vtable for tbb ::task' CMakeFiles\opencv_core.dir/objects.a(parallel.cpp.obj):parallel.cpp:(.text$_ZN3t bb10interface78internal9flag_taskD1Ev[__ZN3tbb10interface78internal9flag_taskD1E v]+0x2): undefined reference to
vtable for tbb::task' c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: CMakeFiles \opencv_core.dir/objects.a(parallel.cpp.obj): bad reloc address 0x2 in section ` .text$_ZN3tbb10interface78internal9flag_taskD1Ev[__ZN3tbb10interface78internal9f lag_taskD1Ev]'collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1233: recipe for target 'bin/ libopencv_core300.dll' failed mingw32-make[2]: * [bin/libopencv_core300.dll] Error 1 CMakeFiles\Makefile2:1325: recipe for target 'modules/core/CMakeFiles/opencv_cor e.dir/all' failed mingw32-make[1]: [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:136: recipe for target 'all' failed mingw32-make: ** [all] Error 2
I got this error while building only TBB with Opencv 3.0.
Thanks