0
votes

I try to make CMake work with my setup (windows 7, 64 bits). I have installed MingGW to have a C and C++ compiler. In the configuration of CMake I entered the following : for the C compiler : C:/MinGW/bin/mingw32-gcc.exe for the C++ compiler : C:/MinGW/bin/mingw32-g++.exe

but when trying to run CMake on a project built with a CMakeList I get the following errors:

The program can't start because libgmp-10.dll is missing from your computer. Try reinstalling the program to fix this problem.

Here is the full ouput:

The CXX compiler identification is unknown Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe Check for working CXX compiler: C:/MinGW/bin/mingw32-g++.exe -- broken CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "C:/MinGW/bin/mingw32-g++.exe" is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/Libraries/deformetrica/build/CMakeFiles/CMakeTmp

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_bbc9e/fast"

C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_bbc9e.dir\build.make CMakeFiles/cmTC_bbc9e.dir/build

mingw32-make.exe[1]: Entering directory
'D:/Libraries/deformetrica/build/CMakeFiles/CMakeTmp'

Building CXX object CMakeFiles/cmTC_bbc9e.dir/testCXXCompiler.cxx.obj

C:\MinGW\bin\mingw32-g++.exe -o
CMakeFiles\cmTC_bbc9e.dir\testCXXCompiler.cxx.obj -c
D:\Libraries\deformetrica\build\CMakeFiles\CMakeTmp\testCXXCompiler.cxx

CMakeFiles\cmTC_bbc9e.dir\build.make:64: recipe for target
'CMakeFiles/cmTC_bbc9e.dir/testCXXCompiler.cxx.obj' failed

mingw32-make.exe[1]: ***
[CMakeFiles/cmTC_bbc9e.dir/testCXXCompiler.cxx.obj] Error 1

mingw32-make.exe[1]: Leaving directory
'D:/Libraries/deformetrica/build/CMakeFiles/CMakeTmp'

Makefile:125: recipe for target 'cmTC_bbc9e/fast' failed

mingw32-make.exe: *** [cmTC_bbc9e/fast] Error 2

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:3 (project)

Configuring incomplete, errors occurred! See also "D:/Libraries/deformetrica/build/CMakeFiles/CMakeOutput.log". See also "D:/Libraries/deformetrica/build/CMakeFiles/CMakeError.log".

g++ was installed with MinGW and I did not see any error on the installation so I was wondering how this could be fixed ?

Thanks a lot for your help !

1
You should list the full command used to invoke cmake. Just cut & paste the entire terminal window, preferably including the command prompt that appeared after the program finished too.burito

1 Answers

0
votes

You need to append the MinGW bin folder to the PATH environment variable.

You can have a look here for the setup: How do I add the MinGW bin directory to my system path?