CLion启动项目失败的解决方法

今天用CLion打开老师不值得项目是发生了不知名的错误,明明和跟着步骤走的但最终却运行失败。

提示信息如下

CMake Error at E:/Clion/CLion 2017.3.4/bin/cmake/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "E:/codeblocks/MinGW/bin/gcc.exe" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: C:/Users/admin/Desktop/鏉�/DongmenDB-master/cmake-build-debug/CMakeFiles/CMakeTmp

  

  Run Build Command:"E:/codeblocks/MinGW/bin/mingw32-make.exe"
  "cmTC_9286f/fast"

  E:/codeblocks/MinGW/bin/mingw32-make.exe -f
  CMakeFiles\cmTC_9286f.dir\build.make CMakeFiles/cmTC_9286f.dir/build

  mingw32-make.exe[1]: Entering directory
  'C:/Users/admin/Desktop/鏉�/DongmenDB-master/cmake-build-debug/CMakeFiles/CMakeTmp'


  Building C object CMakeFiles/cmTC_9286f.dir/testCCompiler.c.obj

  E:\codeblocks\MinGW\bin\gcc.exe -o
  CMakeFiles\cmTC_9286f.dir\testCCompiler.c.obj -c
  C:\Users\admin\Desktop\閺変繐DongmenDB-master\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c


  gcc.exe: error:
  C:\Users\admin\Desktop\閺変繐DongmenDB-master\cmake-build-debug\CMakeFiles\CMakeTmp\testCCompiler.c:
  No such file or directory

  gcc.exe: fatal error: no input files

  compilation terminated.

  CMakeFiles\cmTC_9286f.dir\build.make:64: recipe for target
  'CMakeFiles/cmTC_9286f.dir/testCCompiler.c.obj' failed

  mingw32-make.exe[1]: *** [CMakeFiles/cmTC_9286f.dir/testCCompiler.c.obj]
  Error 1

  mingw32-make.exe[1]: Leaving directory
  'C:/Users/admin/Desktop/鏉�/DongmenDB-master/cmake-build-debug/CMakeFiles/CMakeTmp'


  Makefile:125: recipe for target 'cmTC_9286f/fast' failed

  mingw32-make.exe: *** [cmTC_9286f/fast] Error 2

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:8 (PROJECT)


-- Configuring incomplete, errors occurred!
See also "C:/Users/admin/Desktop/鏉�/DongmenDB-master/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/admin/Desktop/鏉�/DongmenDB-master/cmake-build-debug/CMakeFiles/CMakeError.log".
 

运行按钮也是灰色的

 

以上大部分信息无用,最重要的一句为

The C compiler "E:/codeblocks/MinGW/bin/gcc.exe" is not able to compile a
  simple test program.

还有诸如 鏉� 的乱码

问题就在这里了,由此想到编码问题,像极了以前遇到过的中文导入出现乱码。于是查看了项目的路径

C:\Users\admin\Desktop\杂\DongmenDB-master

解决方法

将项目文件名改为英文,即路径中不能存在中文。

所以以后还是尽量使用英文文件名吧。

 

  • 16
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值