CMake错误:CMake无法找到与" MinGW Makefiles"相对应的构建程序。

时间:2017-07-17 17:22:29

标签: c++ cmake box2d

我正在尝试使用cmake为c ++构建Box2D库。当我运行cmake gui时,我收到错误:

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Configuring incomplete, errors occurred!

像这些人这样的大多数问题已经回答说"添加MinGw / bin到PATH"但我已经在PATH上有了这个。还有什么可能导致这个错误?

2 个答案:

答案 0 :(得分:4)

mingw32-make.exe可以通过相应的复选框与标准的MinGW32安装程序一起安装:

MinGW32 Installation Manager screenshot

正如rubenvb指出的那样,你仍然需要确保它进入你的PATH。如果通过“系统属性”编辑环境变量,请务必关闭并重新打开CMake GUI。

如果您更习惯使用make.exe,请安装MSYS并使用 MSYS Makefiles 作为CMake生成器。您还需要将mingw\binmsys\1.0\bin放入路径中。

答案 1 :(得分:1)

我遇到了同样的问题,并将这三个问题添加到我的系统路径中,并解决了错误。

C:\ Program Files \ mingw-w64 \ x86_64-7.3.0-posix-seh-rt_v5-rev0 \ mingw64 \ bin

C:\ Program Files \ CMake \ bin

C:\ opencv \ build \ install \ x64 \ mingw \ bin