MantisBT - CMake
View Issue Details
0015869CMakeCMakepublic2015-12-01 15:112016-05-02 08:30
Igor Mironchik 
 
highmajoralways
closedno change required 
Asus X553MWindows7 64bit
CMake 3.4 
 
0015869: g++ from MinGw check already failes
g++ compiler from MinGw check already failes. MinGw version is 2013072200, just downloaded
Clone GoogleTest repository.

Run cmake -G "MinGW Makefiles"
d:\work\googletest>cmake -G "MinGW Makefiles"
-- The CXX compiler identification is unknown
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/CMakeTestCXX
Compiler.cmake:54 (message):
  The C++ compiler "C:/MinGW/bin/g++.exe" is not able to compile a simple
  test program.

  It fails with the following output:

   Change Dir: D:/work/googletest/CMakeFiles/CMakeTmp



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

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

  mingw32-make.exe[1]: Entering directory
  'D:/work/googletest/CMakeFiles/CMakeTmp'

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

  C:\MinGW\bin\g++.exe -o CMakeFiles\cmTC_3b719.dir\testCXXCompiler.cxx.obj
  -c D:\work\googletest\CMakeFiles\CMakeTmp\testCXXCompiler.cxx

  g++.exe: error: CreateProcess: No such file or directory

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

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

  mingw32-make.exe[1]: Leaving directory
  'D:/work/googletest/CMakeFiles/CMakeTmp'

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

  mingw32-make.exe: *** [cmTC_3b719/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:/work/googletest/CMakeFiles/CMakeOutput.log".
See also "D:/work/googletest/CMakeFiles/CMakeError.log".

d:\work\googletest>g++.exe
g++.exe: fatal error: no input files
compilation terminated.

d:\work\googletest>
No tags attached.
log CMakeError.log (8,359) 2015-12-01 15:57
https://public.kitware.com/Bug/file/5586/CMakeError.log
log CMakeOutput.log (26,944) 2015-12-01 15:57
https://public.kitware.com/Bug/file/5587/CMakeOutput.log
Issue History
2015-12-01 15:11Igor MironchikNew Issue
2015-12-01 15:19Brad KingNote Added: 0039932
2015-12-01 15:57Igor MironchikFile Added: CMakeError.log
2015-12-01 15:57Igor MironchikFile Added: CMakeOutput.log
2015-12-01 15:58Igor MironchikNote Added: 0039933
2015-12-01 16:01Brad KingNote Added: 0039934
2015-12-01 16:10Igor MironchikNote Added: 0039935
2015-12-01 16:13Igor MironchikNote Added: 0039936
2015-12-01 16:19Brad KingNote Added: 0039937
2015-12-01 16:19Brad KingStatusnew => resolved
2015-12-01 16:19Brad KingResolutionopen => no change required
2015-12-03 02:23Igor MironchikNote Added: 0039941
2015-12-03 08:19Brad KingNote Added: 0039946
2015-12-03 09:36Igor MironchikNote Added: 0039949
2016-05-02 08:30Robert MaynardNote Added: 0040976
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0039932)
Brad King   
2015-12-01 15:19   
The first question is why the compiler id check fails:

> -- The CXX compiler identification is unknown

The log files listed at the end of the output may have more details:

> See also "D:/work/googletest/CMakeFiles/CMakeOutput.log".
> See also "D:/work/googletest/CMakeFiles/CMakeError.log".
(0039933)
Igor Mironchik   
2015-12-01 15:58   
Hi, I've uploaded files. Sorry, didn't pay attention on:

> See also "D:/work/googletest/CMakeFiles/CMakeOutput.log".
> See also "D:/work/googletest/CMakeFiles/CMakeError.log".
(0039934)
Brad King   
2015-12-01 16:01   
Thanks. CMakeError.log reports failure to identify the C++ compiler with:

 g++.exe: error: CreateProcess: No such file or directory

Try this:

 $ touch empty.cxx
 $ g++ empty.cxx
(0039935)
Igor Mironchik   
2015-12-01 16:10   
I've received following output:

g++.exe error: CreateProcess: No such file or directory
(0039936)
Igor Mironchik   
2015-12-01 16:13   
Seems, that this is MinGw g++ bug?!
(0039937)
Brad King   
2015-12-01 16:19   
Yes, it seems CMake is correctly reporting that g++ is not able to build a simple test program.
(0039941)
Igor Mironchik   
2015-12-03 02:23   
Hi,

I've just finished conversation on MinGw bug tracker, and faced that g++ should'n build and link empty file into executable, because there is no main entry point in empty source. I even don't understand how I did'n think about this by myself... But it doesn't matter.

Are you sure that g++ should build executable from empty file?

May be this is CMake's bug though?
(0039946)
Brad King   
2015-12-03 08:19   
Create a "main.cpp" file containing "int main() { return 0; }" and try compiling that with g++.
(0039949)
Igor Mironchik   
2015-12-03 09:36   
Yes, you are right. Build failed with the same symptoms.
(0040976)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.