Welcome to the Qt online installer: next
Qt Account - your unified login to everything Qt: skip
Setup-Qt: next
installation folder: D:\Qt-Opencv\Qt
select components: Qt-Qt5.9-MingGW 5.3.0 32 bit
select components: Qt-Tools-MinGW 5.3.0
License Agreement: agree and next
start menu shortcuts: next
ready to install: install
Welcome to the CMake etup Wizzard: next
End-User License Agreement: 勾选Accept and next
Install options: 勾选 Add CMake to the system PATH for all users, next
Destination folder: C:\Program Files\CMake (default), next
Ready to install CMake, Install
Where is the source code: D:\Qt-Opencv\opencv-3.2.0\sources
Where to build the binaries: D:\opencv-build
点击finish,然后cmake进行配置。
勾选WITH_OPENGL和WITH_QT,去除掉WITH_IPP;
再次configure;
对出现的红色部分进行选择:
Set QT_MAKE_EXECUTABLE to D:\Qt\5.9\mingw53_32\bin\qmake.exe Set Qt5Concurrent_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5Concurrent Set Qt5Core_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5Core Set Qt5Gui_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5Gui Set Qt5Test_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5Test Set Qt5Widgets_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5Widgets Set Qt5OpenGL_DIR to D:\Qt\5.9\mingw53_32\lib\cmake\Qt5OpenGL Set CMAKE_BUILD_TYPE to Release or RelWithDebInfo
错误:in the file opencv/sources/modules/videoio/src/cap_dshow.cpp, you have the following error : 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope ...
解决:put the following line: #define NO_DSHOW_STRSAFE, before the line : #include "DShow.h"