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

解决方法

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

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

 

你可能感兴趣的:(经验)