Qt5.1 + opencv3.4 + Windows(MSVC2017)配置

opencv-3.4.0-vc14_vc15
qt-opensource-windows-x86-5.14.0.exe
cmake3.14
https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows_with_MSVC2017

cmake:

点击 Configure 配置
Where is the source code: C:/opencv/sources
Where to build the binaries: C:/opencv_build
Visual Studio 15 2017

配置完成确认:
[X]WITH_QT
[X]WITH_OPENGL
[ ]WITH_IPP
[ ]WITH_CUDA

点击 Configure 配置

Qt5Concurrent_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5Concurrent
Qt5Core_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5Core
Qt5Gui_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5Gui
Qt5Test_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5Test
Qt5Widgets_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5Widgets
Qt5OpenGL_DIR to D:\Qt\5.14\msvc2017_64\lib\cmake\Qt5OpenGL

点击 Generate

cmd:

cd opencv-build
mingw32-make -j8

.pro自动配置

Qt5.1 + opencv3.4 + Windows(MSVC2017)配置_第1张图片

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/'../../../Program Files/opencv340/opencv/build/x64/vc14/bin/release/' -lopencv_core340d
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/'../../../Program Files/opencv340/opencv/build/x64/vc14/bin/debug/' -lopencv_core340d

INCLUDEPATH += $$PWD/'../../../Program Files/opencv340/opencv/build/include'
DEPENDPATH += $$PWD/'../../../Program Files/opencv340/opencv/build/include'

其他

https://blog.csdn.net/KID_yuan/article/details/86769144
https://blog.csdn.net/LZXTSL/article/details/82844603
https://dotuyau.wordpress.com/2014/04/25/opencv_qt_windows/
https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows

你可能感兴趣的:(QT)