C编译器损坏:无法编译简单的测试程序 [英] C compiler broken: is not able to compile a simple test program

查看:805
本文介绍了C编译器损坏:无法编译简单的测试程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Dektop和Surface Pro 6上,CLion停止工作,我不知道为什么。

On my Dektop and on my Surface Pro 6 CLion has stopped working and I don´t know exactly why.

它写在我的台式机上:

"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:

And for my 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".

[无法重新加载]

推荐答案

查看标题的先前答案:如何在MinGW或MinGW-w64中使用CMAKE来编译Clion:

Check out the previous answer to the title: How to use CMAKE in MinGW or MinGW-w64 to compile Clion:

CLion:错误:C编译器 C:/MinGW/bin/gcc.exe;无法编译简单的测试程序

答案是:您不应该让 sh.exe 在您的 PATH 环境变量中,它是已知会导致问题。

The answer is: you shouldn't let sh.exe in your PATH environment variable, it's known to cause problem.

或者使用忍者作为替代方法。

Or to use ninja as an alternative to make.

这篇关于C编译器损坏:无法编译简单的测试程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆