huihut / OpenCV-MinGW-Build

👀 MinGW 32bit and 64bit version of OpenCV compiled on Windows. Including OpenCV 3.3.1, 3.4.1, 3.4.1-x64, 3.4.5, 3.4.6, 3.4.7, 3.4.8-x64, 3.4.9, 4.0.0-alpha-x64, 4.0.0-rc-x64, 4.0.1-x64, 4.1.0, 4.1.0-x64, 4.1.1-x64, 4.5.0-with-contrib, 4.5.2-x64
https://opencv.org/
963 stars 219 forks source link

OpenCv 4 for x32 build #11

Closed darkworks closed 5 years ago

darkworks commented 5 years ago

hi can you please share OpenCv v4 build for x32 for QT mingw730_32 as i noticed all opencv 4 builds are for x64

thanks

huihut commented 5 years ago

OpenCV 4.1.0 | zip | tar.gz

git clone -b OpenCV-4.1.0 git@github.com:huihut/OpenCV-MinGW-Build.git
darkworks commented 5 years ago

thank you very much for the 32 bit build , but looks like its not compatible with QT creator 4.9.2 i have added it to my project and test it on new open cv blank project too , the app crash when i try to run it

21:56:02: The program has unexpectedly finished.
21:56:02: The process was ended forcefully.

looks like for QT we will need to check the QT option : https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows#OpenCV

 Check the box [X]WITH_QT
 Check the box [X]WITH_OPENGL 

i tired to build 4.1 from source with QT but i get error when i make it

image

huihut commented 5 years ago

1

I have checked Qt and OpenGL, you can see Configuration.

  GUI: 
    QT:                          YES (ver 5.13.0)
      QT OpenGL support:         YES (Qt5::OpenGL 5.13.0)
    Win32 UI:                    YES
    OpenGL support:              YES (opengl32 glu32)
    VTK support:                 NO

You can check if your cv project is properly linked to the opencv library.

E.g

win32 {
INCLUDEPATH += E:\opencv-4.1.0\opencv-4.1.0-x86-build\install\include
LIBS += E:\opencv-4.1.0\opencv-4.1.0-x86-build\install\x86\mingw\bin\libopencv_*.dll
}

2

Regarding your build error, you need to find the first line of Error and then find the reason based on the error message.

And you can see my blog using Google Translate

darkworks commented 5 years ago

ya thanks it was crashing due to missing opencv dll files in the debug directory , so i copied opencv dll file to debug directory after that it would start , so to use this opencv build with QT , the QT dll files need to be linked .pro file like

# OpenCV 4.10 config
INCLUDEPATH += C:\opencv\opeencv4.1\include

LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_core410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_highgui410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_imgcodecs410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_imgproc410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_features2d410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_video410.dll.a
LIBS += C:\opencv\opeencv4.1\x86\mingw\lib\libopencv_videoio410.dll.a

and also the opencv dll files need to be copied to the exe folder of your application. thanks :)