0

I was upgrading my G++ compiler with MinGW to version 8.2.0. Now Cmake is not working anymore.

Working on a 64bit Win10.

It's telling me that "gcc.exe is not able to compile a simple test program". While both compilers, gcc and g++ are working for me on the console.

I already tried reinstalling the compiler several times without any result.

C:\temp>g++ --version
        g++ (MinGW.org GCC-8.2.0-1) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

C:\temp>cmake --version
        cmake version 3.13.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

C:\temp>g++ hello.cpp

        C:\temp>a.exe
        Hello, World!

C:\temp>gcc hello.c

        C:\temp>a.exe
        Hello World

        C:\temp>cmake . -G "MinGW Makefiles"
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
        CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler

"C:/MinGW/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/temp/CMakeFiles/CMakeTmp

        Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_7fbea/fast"
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_7fbea.dir\build.make CMakeFiles/cmTC_7fbea.dir/build
        mingw32-make.exe[1]: Entering directory 'C:/temp/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_7fbea.dir/testCCompiler.c.obj
        C:\MinGW\bin\gcc.exe    -o CMakeFiles\cmTC_7fbea.dir\testCCompiler.c.obj   -c C:\temp\CMakeFiles\CMakeTmp\testCCompiler.c
        Linking C executable cmTC_7fbea.exe
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_7fbea.dir\link.txt --verbose=1
"C:\Program Files\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_7fbea.dir/objects.a
        C:\MinGW\bin\ar.exe cr CMakeFiles\cmTC_7fbea.dir/objects.a @CMakeFiles\cmTC_7fbea.dir\objects1.rsp
        C:\MinGW\bin\ar.exe: could not create temporary file whilst writing archive: no more archived files
CMakeFiles\cmTC_7fbea.dir\build.make:87: recipe for target 'cmTC_7fbea.exe' failed
        mingw32-make.exe[1]: *** [cmTC_7fbea.exe] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/temp/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_7fbea/fast' failed
        mingw32-make.exe: *** [cmTC_7fbea/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 "C:/temp/CMakeFiles/CMakeOutput.log".
See also "C:/temp/CMakeFiles/CMakeError.log".

Any help is very much appreciated!

tkupek
  • 37
  • 7

1 Answers1

1

Switching to mingw-64 solved my issue!

tkupek
  • 37
  • 7