clion环境配置出错,cmake出错,导致简单main.cpp程序不能执行

撸java代码 2020-03-04 12:36:40
"C:\clion\CLion 2019.1.2\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" E:\clion\clion工程文件夹
-- The C compiler identification is unknown
-- 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:/clion/CLion 2019.1.2/bin/cmake/win/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (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: E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):C:/mingw/bin/mingw32-make.exe cmTC_c1b8b/fast
C:/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTC_c1b8b.dir\build.make CMakeFiles/cmTC_c1b8b.dir/build
mingw32-make.exe[1]: Entering directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj
C:\mingw\bin\gcc.exe -o CMakeFiles\cmTC_c1b8b.dir\testCCompiler.c.obj -c E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: E:\clion\clion瀹搞儳鈻奸弬鍥︽婢剁cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
CMakeFiles\cmTC_c1b8b.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj' failed
mingw32-make.exe[1]: *** [CMakeFiles/cmTC_c1b8b.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeTmp'
Makefile:120: recipe for target 'cmTC_c1b8b/fast' failed
mingw32-make.exe: *** [cmTC_c1b8b/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 "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "E:/clion/clion宸ョ鏂囦欢澶/cmake-build-debug/CMakeFiles/CMakeError.log".

[Finished]





不知为什么cmake出现错误请求各位大神帮帮忙
感谢了!!!
...全文
3242 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
横溢天使 2022-01-26
  • 打赏
  • 举报
回复 1

我也是这个问题,请问解决了吗

  • 打赏
  • 举报
回复

请问解决了吗,我也出现了这样的问题呜呜呜呜呜

Om Nom Not Found 2021-08-16
  • 打赏
  • 举报
回复 1

我和你的问题一样,但是路径是没有中文,但还是报错!!!怎么回事啊啊啊啊啊啊啊啊!

-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/gcc.exe - broken
CMake Error at C:/Program Files/JetBrains/CLion 2021.2/bin/cmake/win/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler

"C:/Program Files (x86)/Dev-Cpp/MinGW64/bin/gcc.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/CLion Projects/On Class 2/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):C:/PROGRA~2/Dev-Cpp/MinGW64/bin/mingw32-make.exe -f Makefile cmTC_c9e70/fast && mingw32-make.exe: *** INTERNAL: readdir: No such file or directory
.  Stop.

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 "D:/CLion Projects/On Class 2/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "D:/CLion Projects/On Class 2/cmake-build-debug/CMakeFiles/CMakeError.log".

[无法重新加载]

```

奔波尔灞 2023-02-01
  • 举报
回复
@Om Nom Not Found 这个解决了吗,我的也是这样的。。
四两fan 2020-03-19
  • 打赏
  • 举报
回复 2
注意环境变量配置的时候文件路径尽量不要出现中文,把路径上的中文改成英文试试
泽97 2022-09-03
  • 举报
回复
@四两fan 大哥你是真的牛,真的就是文件路径有中文

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧