gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 16:23:55 24 4
gpt4 key购买 nike

我正在尝试在 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

编辑:

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

====================[ 构建 | Hello World |调试]================================“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.exec:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe:无法打开输出文件HelloWorld.exe:权限被拒绝collect2.exe:错误:ld 返回 1 退出状态mingw32-make.exe[3]: * [HelloWorld.exe] 错误 1CMakeFiles\HelloWorld.dir\build.make:99:目标“HelloWorld.exe”的配方失败mingw32-make.exe[2]: [CMakeFiles/HelloWorld.dir/all] 错误 2CMakeFiles\Makefile2:71:目标“CMakeFiles/HelloWorld.dir/all”的配方失败mingw32-make.exe 1 : [CMakeFiles/HelloWorld.dir/rule] 错误 2CMakeFiles\Makefile2:83:目标“CMakeFiles/HelloWorld.dir/rule”的配方失败mingw32-make.exe: * [HelloWorld] 错误 2Makefile:117: 目标“HelloWorld”的配方失败

最佳答案

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

文件 > 设置 > 构建、执行、部署 > 工具链

CLion 通常可以自动检测它所知道的编译器,但我相信它仍然需要被告知首先要查找哪个编译器。

关于CLion 编译时出错 - 调用堆栈问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53798559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com