1.進入第二部分編譯後的生成文件目錄E:\software\opencv-3.4.2\buildc++
輸入「mingw32-make」命令,按回車進行編譯。windows
等待編譯:ide
發現錯誤: identifier ‘nullptr’ is a keyword in C++11 錯誤ui
解決:this
這是由於c++11引入了nullptr,因此給make添加參數,直接回到cmake添加:命令行
在 cmake-gui 編譯配置中:c++11
勾選 ENABLE_CXX11blog
而後從新Configure-Generate-mingw32-makeit
再次編譯,再次出現: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scopeio
解決:
而後回到命令行,繼續編譯,發現
解決:error: 'MFP_MEDIAITEM_CHARACTERISTICS' has not been declared 參考:https://stackoverflow.com/questions/50333886/opencv-installation-on-windows When not using Visual Studio, you have to disable some features which are not supported. Build with cmake options WITH_IPP=OFF and WITH_MSMF=OFF