一、环境配置:
参考链接https://blog.csdn.net/t980832453/article/details/79396972
https://blog.csdn.net/sinat_36264666/article/details/73200739
二、编译过程中的问题:
1、执行mingw32-make后
28%左右遇到这种错误:
... windres.exe: unknown option -- W ...
解决方案:
在cmake中 取消勾选 ENABLE_PRECOMPILED_HEADERS
2、32%左右遇到这种错误 :
'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope ...
解决方案:
在..\opencv\sources\modules\videoio\src\cap_dshow.cpp
在#include "DShow.h"这一行前加上#define NO_DSHOW_STRSAFE
3、contrib模块下载地址
contrib模块下载地址:https://github.com/opencv/opencv_contrib/releases
4、contrib模块编译报错:
Unknown CMake command "ocv_append_source_files_cxx_compiler_options"
解决方法:下载和opencv对应的contrib模块,重新configure