Ask Your Question

Revision history [back]

Building OpenCV w/ Python 3 + Qt5 Support - DLL problems

Hi all. Been struggling with this all day. I'm working on compiling OpenCV 3.4.1 with Python 3.6.4 (32-bit) and Qt 5.10.1 support using MinGW 5.3.0 (32-bit) on Windows 10 64-bit. I'm compiling from OpenCV sources directly and using MinGW provides alongside Qt5.

I've trimmed many of the options in CMake, but kept the following checked:

BUILD_JPEG
BUILD_PNG
BUILD_SHARED_LIBS
BUILD_opencv_*
ENABLE_OMIT_FRAME_POINTER
ENABLE_PIC
OPENCL_FOUND
USE_WIN32_FILEIO
WITH_DIRECTX
WITH_DSHOW
WITH_FFMPEG
WITH_JPEG
WITH_OPENGL
WITH_PNG
WITH_QT
WITH_VFW
WITH_WIN32UI

I had to make one small fix to cap_dshow.cpp, but aside from that the build goes well and the OpenCV DLL's can be found in "C:\OpenCV\opencv-3.4.1-release\install\x86\mingw\bin". I also have "cv2.cp36-win32.pyd" in C:\Python\Python36-32\Lib\site-packages.

When I launch Python 3.6.4 and run "import cv2" I get one of the following:

ImportError: DLL load failed: %1 is not a valid Win32 application
ImportError: DLL load failed: The specified module could not be found

I'm not sure why I'm getting DLL dependency issues. Everything is for 32-bit as far as I can tell, and has been added to my system path.

I also tried DependencyWalker on cv2.cp36-win32.pyd, and it shows that several DLLs are missing, such as API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL. There's also several that are found in my MikTex install. Not sure if this matter, but though I'd toss it out there.

Any help would be appreciated. Thanks!

Building OpenCV w/ Python 3 + Qt5 Support - DLL problems

Hi all. Been struggling with this all day. I'm working on compiling OpenCV 3.4.1 with Python 3.6.4 (32-bit) and Qt 5.10.1 support using MinGW 5.3.0 (32-bit) on Windows 10 64-bit. I'm compiling from OpenCV sources directly and using MinGW provides alongside Qt5.

I've trimmed many of the options in CMake, but kept the following checked:

BUILD_JPEG
BUILD_PNG
BUILD_SHARED_LIBS
BUILD_opencv_*
ENABLE_OMIT_FRAME_POINTER
ENABLE_PIC
OPENCL_FOUND
USE_WIN32_FILEIO
WITH_DIRECTX
WITH_DSHOW
WITH_FFMPEG
WITH_JPEG
WITH_OPENGL
WITH_PNG
WITH_QT
WITH_VFW
WITH_WIN32UI

I had to make one small fix to cap_dshow.cpp, but aside from that the build goes well and the OpenCV DLL's can be found in "C:\OpenCV\opencv-3.4.1-release\install\x86\mingw\bin". Qt5 w/ OpenCV works perfect. I also have "cv2.cp36-win32.pyd" in C:\Python\Python36-32\Lib\site-packages.

When I launch Python 3.6.4 and run "import cv2" I get one of the following:

ImportError: DLL load failed: %1 is not a valid Win32 application
ImportError: DLL load failed: The specified module could not be found

I'm not sure why I'm getting DLL dependency issues. Everything is for 32-bit as far as I can tell, and has been added to my system path.

I also tried DependencyWalker on cv2.cp36-win32.pyd, and it shows that several DLLs are missing, such as API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL. There's also several that are found in my MikTex install. Not sure if this matter, but though I'd toss it out there.

Any help would be appreciated. Thanks!

Building OpenCV w/ Python 3 + Qt5 Support - DLL problems

Hi all. Been struggling with this all day. I'm working on compiling OpenCV 3.4.1 with Python 3.6.4 (32-bit) and Qt 5.10.1 support using MinGW 5.3.0 (32-bit) on Windows 10 64-bit. I'm compiling from OpenCV sources directly and using MinGW provides provided alongside Qt5.

I've trimmed many of the options in CMake, but kept the following checked:

BUILD_JPEG
BUILD_PNG
BUILD_SHARED_LIBS
BUILD_opencv_*
ENABLE_OMIT_FRAME_POINTER
ENABLE_PIC
OPENCL_FOUND
USE_WIN32_FILEIO
WITH_DIRECTX
WITH_DSHOW
WITH_FFMPEG
WITH_JPEG
WITH_OPENGL
WITH_PNG
WITH_QT
WITH_VFW
WITH_WIN32UI

I had to make one small fix to cap_dshow.cpp, but aside from that the build goes well and the OpenCV DLL's can be found in "C:\OpenCV\opencv-3.4.1-release\install\x86\mingw\bin". Qt5 w/ OpenCV works perfect. I also have "cv2.cp36-win32.pyd" in C:\Python\Python36-32\Lib\site-packages.

When I launch Python 3.6.4 and run "import cv2" I get one of the following:

ImportError: DLL load failed: %1 is not a valid Win32 application
ImportError: DLL load failed: The specified module could not be found

I'm not sure why I'm getting DLL dependency issues. Everything is for 32-bit as far as I can tell, and has been added to my system path.

I also tried DependencyWalker on cv2.cp36-win32.pyd, and it shows that several DLLs are missing, such as API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL. There's also several that are found in my MikTex install. Not sure if this matter, but though I'd toss it out there.

Any help would be appreciated. Thanks!

Building OpenCV w/ Python 3 + Qt5 Support - DLL problems

Hi all. Been struggling with this all day. I'm working on compiling OpenCV 3.4.1 with Python 3.6.4 (32-bit) and Qt 5.10.1 support using MinGW 5.3.0 (32-bit) on Windows 10 64-bit. I'm compiling from OpenCV sources directly and using MinGW provided alongside Qt5.

I've trimmed many of the options in CMake, but kept the following checked:

BUILD_JPEG
BUILD_PNG
BUILD_SHARED_LIBS
BUILD_opencv_*
ENABLE_OMIT_FRAME_POINTER
ENABLE_PIC
OPENCL_FOUND
USE_WIN32_FILEIO
WITH_DIRECTX
WITH_DSHOW
WITH_FFMPEG
WITH_JPEG
WITH_OPENGL
WITH_PNG
WITH_QT
WITH_VFW
WITH_WIN32UI

I had to make one small fix to cap_dshow.cpp, but aside from that the build goes well and the OpenCV DLL's can be found in "C:\OpenCV\opencv-3.4.1-release\install\x86\mingw\bin". Qt5 w/ OpenCV works perfect. I also have "cv2.cp36-win32.pyd" in C:\Python\Python36-32\Lib\site-packages.

When I launch Python 3.6.4 and run "import cv2" I get one of the following:

ImportError: DLL load failed: %1 is not a valid Win32 application
ImportError: DLL load failed: The specified module could not be found

I'm not sure why I'm getting DLL dependency issues. Everything is for 32-bit as far as I can tell, and has been added to my system path.

I also tried DependencyWalker on cv2.cp36-win32.pyd, and it shows that several DLLs are missing, such as API-MS-WIN-CORE-APIQUERY-L1-1-0.DLL. There's also several that are found in my 64-bit MikTex install. Not sure if this matter, but though I'd toss it out there.

Any help would be appreciated. Thanks!