Clion配置MinGW运行环境时报错

Clion配置MinGW运行环境时报错

MinGW配置环境
在这里插入图片描述

-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: E:/MinGw/mingw64/bin/gcc.exe
-- Check for working C compiler: E:/MinGw/mingw64/bin/gcc.exe -- broken
CMake Error at E:/Programming Software/Clion/CLion 2019/bin/cmake/win/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60 (message):
  The C compiler

    "E:/MinGw/mingw64/bin/gcc.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):E:/MinGw/mingw64/bin/mingw32-make.exe cmTC_514c4/fast && E:/MinGw/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_514c4.dir\build.make CMakeFiles/cmTC_514c4.dir/build
    mingw32-make.exe[1]: Entering directory 'E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_514c4.dir/testCCompiler.c.obj
    E:\MinGw\mingw64\bin\gcc.exe    -o CMakeFiles\cmTC_514c4.dir\testCCompiler.c.obj   -c "E:\Programming Software\娴狅絿鐖淺C++缁嬪绨拋鎹愵吀\Clion妞ゅ湱娲癨HelloWorld\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c"
    gcc.exe: error: E:\Programming Software\娴狅絿鐖淺C++缁嬪绨拋鎹愵吀\Clion妞ゅ湱娲癨HelloWorld\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
    gcc.exe: fatal error: no input files
    compilation terminated.
    mingw32-make.exe[1]: *** [CMakeFiles\cmTC_514c4.dir\build.make:65: CMakeFiles/cmTC_514c4.dir/testCCompiler.c.obj] Error 1
    mingw32-make.exe[1]: Leaving directory 'E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeTmp'
    mingw32-make.exe: *** [Makefile:120: cmTC_514c4/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:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeError.log".

在这里插入图片描述

解决方法:

由于我的项目保存路径有中文如下所示:
E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "E:/Programming Software/浠g爜/C++绋嬪簭璁捐/Clion椤圭洰/HelloWorld/cmake-build-debug/CMakeFiles/CMakeError.log".
然而MinGW不允许输出路径有中文,所以只需要将项目路径更改,去掉中文就行,下面是我更改后的路径
E:\Programming Software\Clion\C++\HelloWorld

在这里插入图片描述
如果有解决你的问题希望收藏一下,顺便点个赞!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黑哪有坏心思!

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值