Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles"

Tags:

c++

cmake

box2d

I am trying to use cmake to build the Box2D library for c++. When I run cmake gui I get the error:

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!

Most questions like these people have answered by saying "Add MinGw/bin to the PATH" but I already have that on the PATH. What else could be causing this error?

like image 762
Starfruit Avatar asked Jul 17 '17 17:07

Starfruit


2 Answers

mingw32-make.exe can be installed with the standard MinGW32 installer via the appropriate checkbox:

MinGW32 Installation Manager screenshot

As rubenvb points out, you'll still need to ensure that it makes it into your PATH. If you edit your environment variables via System Properties, be sure to close and reopen the CMake GUI.

If you're more accustomed to using make.exe, install MSYS and use MSYS Makefiles as the CMake generator. You'll also need to put both mingw\bin and msys\1.0\bin into your PATH.

like image 88
jdonald Avatar answered Nov 16 '22 16:11

jdonald


I had the same problem and I added these three to my system path and errors were solved.

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

like image 20
Chamila Maddumage Avatar answered Nov 16 '22 17:11

Chamila Maddumage