Error while compiling OpenCV Pre-Release 4.0.0 with CMAKE
[ 86%] Built target opencv_calib3d_pch_dephelp
[ 86%] Built target pch_Generate_opencv_calib3d [ 88%] Built target opencv_calib3d
[ 88%] Built target opencv_perf_calib3d_pch_dephelp [ 88%] Built target pch_Generate_opencv_perf_calib3d
[ 89%] Built target opencv_perf_calib3d
[ 90%] Built target pch_Generate_opencv_test_calib3d [ 92%] Built target opencv_test_calib3d
[ 92%] Built target opencv_stitching_pch_dephelp
[ 92%] Built target pch_Generate_opencv_stitching
[ 93%] Built target opencv_stitching
[ 93%] Built target opencv_test_stitching_pch_dephelp
[ 93%] Built target pch_Generate_opencv_test_stitching [ 93%] Built target opencv_test_stitching
[ 93%] Built target opencv_perf_stitching_pch_dephelp [ 94%] Built target pch_Generate_opencv_perf_stitching
[ 95%] Built target opencv_perf_stitching
[ 95%] Built target opencv_videostab_pch_dephelp [ 95%] Built target pch_Generate_opencv_videostab
[ 96%] Built target opencv_videostab [ 96%] Built target opencv_test_videostab_pch_dephelp
[ 96%] Built target pch_Generate_opencv_test_videostab [ 97%] Built target opencv_test_videostab
[ 97%] Built target gen_opencv_python_source [ 97%] Linking CXX shared module ..\..\lib\python3\cv2.cp35-win32.pyd
collect2.exe: error: ld returned 5 exit status
mingw32-make[2]: *** [modules\python3\CMakeFiles\opencv_python3.dir\build.make:104: lib/python3/cv2.cp35-win32.pyd] Error 1 mingw32-make[2]: *** Deleting file 'lib/python3/cv2.cp35-win32.pyd'
mingw32-make[1]: *** [CMakeFiles\Makefile2:7584: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
mingw32-make: *** [Makefile:162: all] Error 2
(py3cv4) D:\Python-Virtual\OpenCV-4\opencv\opencv\build>
This is the error occuring. I'm stuck at 97% and trying to build the python module but it doesn't say anything either about what seems to be failing.
cv2.cp35-win32
-- you would have to build 32bit opencv libs, to link to a 32 bit python install.Oh man just realised. I have a 64 bit python install though, how do I ensure the cmake command builds it with 64 bit instread of 32 bit?
use mingw64.
(and i'm curious, if you can get this to fly. it compiled all fine here, but would crash python, when trying to import it, python3.5, mingw64 7.2, opencv3.4.3)
hey, I just did! It's the same error except the version of the cv2 file is now
cv2.cp35-win_amd64.pyd
.And it actually is OpenCV 4.0.0 pre haha, and mingw64 is 8.1
maybe you could add the python relevant cmake flags to your question ?
I have all the python related flags properly put In the CMAKE GUI.
https://imgur.com/a/pLF1RMK This is my CMAKE GUI Screenshot. Please let me know if I might be missing something. Thanks a lot!
please, no screenshots(can't be quoted/indexed). and no external bins(will be gone, tomorrow). please.
Oh okay! Will keep that in mind, I will erase the link as soon as I can. Thought screenshot would be a better idea to show all the flags since there are so many.
Cool thing, so what's the solution? All the CMAKE flags are there, now what should I do?
well oh: python3 library -- this probably expects an
.a
not the.dll