I have been following the steps in this link: https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows
I am currently using Qt 5.10 with latest OpenCV 3.4.0. I also have Python 3.6.3 installed.
I have meet some errors at steps mingw32-make -j 4.
This is the error I copied from Command Prompt:
[100%] Linking CXX shared module ..\..\lib\python3\cv2.cp36-win_amd64.pyd
C:/Users/user/AppData/Local/Programs/Python/Python36/libs/libpython36.a: error adding symbols: File format not recognized
collect2.exe: error: ld returned 1 exit status
modules\python3\CMakeFiles\opencv_python3.dir\build.make:114: recipe for target 'lib/python3/cv2.cp36-win_amd64.pyd' failed
mingw32-make[2]: *** [lib/python3/cv2.cp36-win_amd64.pyd] Error 1
CMakeFiles\Makefile2:4081: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
mingw32-make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Can someone explained to me what error am I facing and how do I solve this problem? Is there some file that I am missing?
I tried to google search the error but didnt get any good explanation or solution to this problem.
Sorry for my bad English and thanks in advance.
Edit: I found this link: https://pypi.python.org/pypi/opencv-python where it has cp36-win_amd64.pyd that are available to download. But I did change any thing in the file yet as I am unsure what is the error that I am currently facing.
Edit2: I found out that in this link: https://github.com/opencv/opencv_contrib/issues/971, there is someone having the same problem as mine. Haven't solve the problem yet but looking into it.
Edit3: I have tried the steps with Python 3.6.4. Also have the same issues. This is the CMakeList.txt for OpenCV Python part. Here's the whole CMakeList.txt : https://github.com/opencv/opencv/blob/master/CMakeLists.txt
if(BUILD_opencv_python3)
status("")
status(" Python 3:")
status(" Interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE NO)
if(PYTHON3LIBS_VERSION_STRING)
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES} (ver ${PYTHON3LIBS_VERSION_STRING})" ELSE NO)
else()
status(" Libraries:" HAVE_opencv_python3 THEN "${PYTHON3_LIBRARIES}" ELSE NO)
endif()
status(" numpy:" PYTHON3_NUMPY_INCLUDE_DIRS THEN "${PYTHON3_NUMPY_INCLUDE_DIRS} (ver ${PYTHON3_NUMPY_VERSION})" ELSE "NO (Python3 wrappers can not be generated)")
status(" packages path:" PYTHON3_EXECUTABLE THEN "${PYTHON3_PACKAGES_PATH}" ELSE "-")
endif()
status("")
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE NO)
if(PYLINT_FOUND AND PYLINT_EXECUTABLE)
status(" Pylint:" PYLINT_FOUND THEN "${PYLINT_EXECUTABLE} (ver: ${PYLINT_VERSION}, checks: ${PYLINT_TOTAL_TARGETS})" ELSE NO)
endif()