Сбой компилятора C: не может скомпилировать простую тестовую программу - PullRequest
0 голосов
/ 01 мая 2019

На моем Dektop и на Surface Pro 6 CLion перестал работать, и я не знаю точно, почему.

Это написано на моем рабочем столе:

"C:\Program Files\JetBrains\CLion 2018.3.2\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\Alexander\Desktop\Clion\übung 
-- The C compiler identification is GNU 6.3.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/JetBrains/CLion 2018.3.2/bin/cmake/win/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:/Users/Alexander/Desktop/Clion/übung/cmake-build-debug/CMakeFiles/CMakeTmp 

Run Build Command:"C:/MinGW/bin/mingw32-make.exe" "cmTC_254a1/fast" 
C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_254a1.dir\build.make CMakeFiles/cmTC_254a1.dir/build 
mingw32-make.exe[1]: Entering directory 'C:/Users/Alexander/Desktop/Clion/³bung/cmake-build-debug/CMakeFiles/CMakeTmp' 
Building C object CMakeFiles/cmTC_254a1.dir/testCCompiler.c.obj 
C:\MinGW\bin\gcc.exe -o CMakeFiles\cmTC_254a1.dir\testCCompiler.c.obj -c C:\Users\Alexander\Desktop\Clion\├�bung\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c 
gcc.exe: error: C:\Users\Alexander\Desktop\Clion\├�bung\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory 
gcc.exe: fatal error: no input files 
compilation terminated. 
CMakeFiles\cmTC_254a1.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_254a1.dir/testCCompiler.c.obj' failed 
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_254a1.dir/testCCompiler.c.obj] Error 1 
mingw32-make.exe[1]: Leaving directory 'C:/Users/Alexander/Desktop/Clion/³bung/cmake-build-debug/CMakeFiles/CMakeTmp' 
Makefile:120: recipe for target 'cmTC_254a1/fast' failed 
mingw32-make.exe: *** [cmTC_254a1/fast] Error 2 
CMake will not be able to correctly generate this project. 
Call Stack (most recent call first): 
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! 
See also "C:/Users/Alexander/Desktop/Clion/übung/cmake-build-debug/CMakeFiles/CMakeOutput.log". 
See also "C:/Users/Alexander/Desktop/Clion/übung/cmake-build-debug/CMakeFiles/CMakeError.log".

И для моегоSurface Pro 6:

"C:\Program Files\JetBrains\CLion 2018.3.2\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\Alexander\Desktop\CLion\udemy-übung-arrays 
-- The C compiler identification is GNU 7.1.0 
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-7.1.0-posix-seh-rt_v5-rev0/mingw64/bin/gcc.exe 
-- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-7.1.0-posix-seh-rt_v5-rev0/mingw64/bin/gcc.exe -- broken 
CMake Error at C:/Program Files/JetBrains/CLion 2018.3.2/bin/cmake/win/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message): 
The C compiler

"C:/Program Files/mingw-w64/x86_64-7.1.0-posix-seh-rt_v5-rev0/mingw64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: C:/Users/Alexander/Desktop/CLion/udemy-übung-arrays/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command:"C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe" "cmTC_d8abd/fast" 
C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_d8abd.dir\build.make CMakeFiles/cmTC_d8abd.dir/build 
mingw32-make.exe[1]: Entering directory 'C:/Users/Alexander/Desktop/CLion/udemy-³bung-arrays/cmake-build-debug/CMakeFiles/CMakeTmp' 
Building C object CMakeFiles/cmTC_d8abd.dir/testCCompiler.c.obj 
C:\PROGRA~1\MINGW-~1\X86_64~1.0-P\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_d8abd.dir\testCCompiler.c.obj -c C:\Users\Alexander\Desktop\CLion\udemy-├�bung-arrays\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c 
gcc.exe: error: C:\Users\Alexander\Desktop\CLion\udemy-├�bung-arrays\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory 
gcc.exe: fatal error: no input files 
compilation terminated. 
CMakeFiles\cmTC_d8abd.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_d8abd.dir/testCCompiler.c.obj' failed 
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_d8abd.dir/testCCompiler.c.obj] Error 1 
mingw32-make.exe[1]: Leaving directory 'C:/Users/Alexander/Desktop/CLion/udemy-³bung-arrays/cmake-build-debug/CMakeFiles/CMakeTmp' 
Makefile:120: recipe for target 'cmTC_d8abd/fast' failed 
mingw32-make.exe: *** [cmTC_d8abd/fast] Error 2 
CMake will not be able to correctly generate this project. 
Call Stack (most recent call first): 
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred! 
See also "C:/Users/Alexander/Desktop/CLion/udemy-übung-arrays/cmake-build-debug/CMakeFiles/CMakeOutput.log". 
See also "C:/Users/Alexander/Desktop/CLion/udemy-übung-arrays/cmake-build-debug/CMakeFiles/CMakeError.log".

[Не удалось перезагрузить]

1 Ответ

0 голосов
/ 01 мая 2019

Ознакомьтесь с предыдущим ответом на заголовок: Как использовать CMAKE в MinGW или MinGW-w64 для компиляции Clion:

CLion: Ошибка: Компилятор C "C: /MinGW/bin/gcc.exe" не может скомпилировать простую тестовую программу

Ответ таков: вы не должны указывать sh.exe в переменной PATH, это , как известно, вызывает проблему.

Или использовать ниндзя в качестве альтернативы для создания.

...