gpt4 book ai didi

c++ - Clion 无法打开输出文件,权限被拒绝

转载 作者:塔克拉玛干 更新时间:2023-11-03 07:42:08 26 4
gpt4 key购买 nike

所以我试图在 Clion 上运行一些 c++ 代码,但每次我尝试用它来读取文件时,都会发生这种情况:

"C:\Program Files\JetBrains\CLion 2017.3\bin\cmake\bin\cmake.exe" --build C:\Users\Collin\Documents\School\C++\exercises\3.smartIO\cmake-build-debug --target 3_smartIO -- -j 4
[ 50%] Linking CXX executable 3_smartIO.exe
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot open output file 3_smartIO.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
CMakeFiles\3_smartIO.dir\build.make:95: recipe for target '3_smartIO.exe' failed
mingw32-make.exe[3]: *** [3_smartIO.exe] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/3_smartIO.dir/all' failed
mingw32-make.exe[2]: *** [CMakeFiles/3_smartIO.dir/all] Error 2
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/3_smartIO.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/3_smartIO.dir/rule] Error 2
Makefile:117: recipe for target '3_smartIO' failed
mingw32-make.exe: *** [3_smartIO] Error 2

据我了解,这意味着由于权限问题它无法打开文件。我尝试检查文件是否已经在运行(事实并非如此),我尝试在运行前将其删除,但这也不起作用。

我还认为我将它保存在 Google 驱动器中可能是个问题,但当它不在驱动器中时也会发生这种情况。

有人有什么建议吗?我在某处读到错误代码 1 表示任务仍在运行。我查看了任务管理器,但找不到正在运行的程序。

编辑:好吧,刚刚尝试重新启动我的笔记本电脑,这确实有效。这意味着问题确实是程序在我尝试运行它时仍在运行。新的问题是:为什么我找不到它的任何踪迹?

最佳答案

更有可能的是,您的目标文件 3_smartIO.exe 受到另一个正在运行的进程的保护,因此,您是否尝试将其 (clion) 关闭并再次打开?它应该对你有帮助。

关于c++ - Clion 无法打开输出文件,权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47654526/

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