Compiling OpenCV on Windows with MinGW

不打扰是莪最后的温柔 提交于 2019-12-25 04:33:34

问题


I am trying to build OpenCV from source using CLion with MinGW on Windows 10. Unfortunately the provided builds for OpenCV do not include a MinGW build any more.

When compiling, I get an error that strsafe.h is missing, although I have Windows SDK and Visual Studio 2015 C++ tools installed.

Has anyone tried building OpenCV on the same setup?

Tanks!


回答1:


Yes, I have recently succesfully built OpenCV 3.0 on Windows 10 and 7 using MinGW-w64 for use with CLion.

Suggestions, based on my experience:

  • Use latest MinGW or MinGW-w64. Older versions have some quirks with supporting C++11 standart and being compatible with Win stuff at the same time, and I was not able to built OpenCV as a result
  • Use latest OpenCV version. I had some problems when trying to compile older releases (for example OpenCV 3.0 BETA)
  • Disable IPP. For some reason it doesn't compile with MinGW, and I was not motivated enough to find out why.

Of course, you have to ensure that correct MinGW is being hooked up during build (in case you have multiple installed), clean cmake binary dir between changes and so on.




回答2:


After some further investigation it turned out that the Windows 10 Sdk did not install properly. Even with the Windows Software Development Kit checked during installation, which adds the headers, there were no include folders with headers actually installed.



来源:https://stackoverflow.com/questions/36374039/compiling-opencv-on-windows-with-mingw

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!