一、環境配置:
參考鏈接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