Not sure how to build OpenCV for MinGW

前端 未结 2 1510
太阳男子
太阳男子 2020-12-10 09:23

TL;DR;

I am trying to build OpenCV for MinGW. cmake keeps complaining about no sane CXX compiler, although I can compile sample code with g++.exe.

相关标签:
2条回答
  • 2020-12-10 09:29

    I tried everthing mentioned here and CMAKE_MAKE_PROGRAM not found but nothing helped. Then restarted the computer and it works.

    0 讨论(0)
  • 2020-12-10 09:45
    1. cleanup! delete all previous build attempts, CmakeFile.cache, etc.

    2. have MingW/bin on the path

    3. make a folder within the opencv dir, called build_mingw, cd there

    4. cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER=mingw32-g++.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe .. # <-- note the dots at the end

    5. mingw32-make

    6. mingw32-make install

    0 讨论(0)
提交回复
热议问题