1.进入第二部分编译后的生成文件目录E:\software\opencv-3.4.2\build
输入“mingw32-make”命令,按回车进行编译。
等待编译:
发现错误: identifier ‘nullptr’ is a keyword in C++11 错误
解决:
这是因为c++11引入了nullptr,所以给make添加参数,直接回到cmake添加:
在 cmake-gui 编译配置中:
勾选 ENABLE_CXX11
然后重新Configure-Generate-mingw32-make
再次编译,再次出现: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope
解决:
然后回到命令行,继续编译,发现
解决: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