首页 文章

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

提问于
浏览
2

所以我试图在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

根据我的理解,这意味着由于权限问题,它无法打开文件 . 我试过检查文件是否已经运行(事实并非如此),我试图在运行之前将其删除,这也无效 .

我还以为我将它保存在谷歌驱动器中可能是个问题,但这也发生在它不在驱动器中时 .

有没有人有什么建议?我在某处读到错误代码1表示任务仍在运行 . 我看过任务管理器,但我发现程序没有运行 .

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

1 回答

  • 0

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

相关问题