我是第一次使用这个IDE,在Windows上编程,我已经安装了MinGW并将其添加到环境变量中,一切都正常,我可以从“cmd”编译和执行代码,但是当我运行CLion时,出现以下错误:
-- C编译器标识是GNU 6.3.0
-- C++编译器标识是GNU 6.3.0
-- 检查工作C编译器:C:/MinGW/bin/gcc.exe
-- 检查工作C编译器:C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files/JetBrains/CLion 2017.3.1/bin/cmake/share/cmake-3.9/Modules/CMakeTestCCompiler.cmake:51 (message):
C编译器“C:/MinGW/bin/gcc.exe”无法编译一个简单的测试程序。
它以以下输出失败:
更改目录:C:/Users/noName/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp 运行构建命令:"C:/MinGW/bin/mingw32-make.exe" "cmTC_2e43b/fast" C:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_2e43b.dir\build.make CMakeFiles/cmTC_2e43b.dir/build mingw32-make.exe1:进入目录 'C:/Users/noName/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp' CMakeFiles\cmTC_2e43b.dir\build.make:64: 目标 'CMakeFiles/cmTC_2e43b.dir/testCCompiler.c.obj' 的规则失败 process_begin: CreateProcess(C:\Users\noName\AppData\Local\Temp\make2428-1.bat, C:\Users\noName\AppData\Local\Temp\make2428-1.bat, ...) 失败。 make (e=2):系统找不到指定的文件。 mingw32-make.exe1: *** [CMakeFiles/cmTC_2e43b.dir/testCCompiler.c.obj] 错误 2 mingw32-make.exe1:离开目录 'C:/Users/noName/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp' Makefile:125: 目标 'cmTC_2e43b/fast' 的规则失败 mingw32-make.exe: *** [cmTC_2e43b/fast] 错误 2 CMake将无法正确生成此项目。 调用堆栈(最近的调用在最上面):CMakeLists.txt:1 (project) -- 配置不完整,发生了错误! 请参阅 "C:/Users/noName/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeOutput.log"。 请参阅 "C:/Users/noName/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeError.log"。 错误代码:1这是图片。我认为这是与CMake有关的错误(?)