CLion编译时出错-调用堆栈问题

时间:2018-12-16 00:57:15

标签: c clion

我正在尝试在clion中编译一个hello world文件,但是我一直收到此错误

"C:\Program Files\JetBrains\CLion 2018.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" C:\Users\NAME\CLionProjects\HelloWorld 
CMake Error at C:/Program Files/JetBrains/CLion 2018.3.1/bin/cmake/win/share/cmake-3.13/Modules/CMakeDetermineCompilerId.cmake:523 (file): 
    file STRINGS file
    "C:/Users/NAME/CLionProjects/HelloWorld/cmake-build-debug/CMakeFiles/3.13.1/CompilerIdC/a.exe"
    cannot be read. 

我如何摆脱它?

Image of tooltip section

编辑:

我不断收到以下编译错误:

==================== [构建| HelloWorld |调试] ============================== “ C:\ Program Files \ JetBrains \ CLion 2018.3.1 \ bin \ cmake \ win \ bin \ cmake.exe” --build C:\ Users \ ssez \ CLionProjects \ HelloWorld \ cmake-build-debug --target HelloWorld- --j 4 [33%]链接C可执行文件HelloWorld.exe c:/ mingw / bin /../ lib / gcc / mingw32 / 6.3.0 /../../../../ mingw32 / bin / ld.exe:无法打开输出文件HelloWorld.exe:权限被拒绝 collect2.exe:错误:ld返回1退出状态 mingw32-make.exe [3]: * [HelloWorld.exe]错误1 CMakeFiles \ HelloWorld.dir \ build.make:99:目标“ HelloWorld.exe”的配方失败 mingw32-make.exe [2]: [CMakeFiles / HelloWorld.dir / all]错误2 CMakeFiles \ Makefile2:71:目标'CMakeFiles / HelloWorld.dir / all'的配方失败 mingw32-make.exe 1 [CMakeFiles / HelloWorld.dir / rule]错误2 CMakeFiles \ Makefile2:83:目标'CMakeFiles / HelloWorld.dir / rule'的配方失败 mingw32-make.exe:* [HelloWorld]错误2 Makefile:117:目标“ HelloWorld”的配方失败

1 个答案:

答案 0 :(得分:0)

在同时安装MinGW和CLion之后,是否在CLion中设置了工具链?

File > Settings > Build, Execution, Deployment > Toolchains

CLion通常可以自动检测它知道的编译器,但是我认为仍然必须先告诉它要寻找哪个编译器。