gintas
gintas

Reputation: 2178

Cmake with MinGW fails compile test

I am trying to compile OpenCV on windows using CMAKE and MinGW on Windows. However, when I try to do that I am getting the following error:

The C compiler identification is GNU
The CXX compiler identification is GNU
Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error: Generator: execution of make failed. Make command was: make "cmTryCompileExec\fast"
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.

Does anyone know what could be an issue?

Upvotes: 3

Views: 1666

Answers (1)

Danduk82
Danduk82

Reputation: 839

Are you running CMAKE within the MinGW shell or within CMD.exe? The first suggestion I can give you is to use MinGW shell because several environment variables are better setup for the compiler in this way. Otherwise you may have to tweak a little your windows environment variables.

You may have also installed Cygwin (and installed gcc also in cygwin). In this case, if you use CMD.exe and that the bin directory of Cygwin is read first than the one of MinGW in the system PATH variable, you can get this kind of errors too.

Upvotes: 1

Related Questions