Eclipse C/C++“权限被拒绝”错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28998275/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:29:02  来源:igfitidea点击:

Eclipse C/C++ "Permission Denied" error

c++ceclipsepermissionscompiler-errors

提问by Gizem ?etin

I'm using Eclipse Helios in Windows7 for C/C++ programming. I wrote a basic C++ code and tried to compile. The output is:

我在 Windows7 中使用 Eclipse Helios 进行 C/C++ 编程。我写了一个基本的 C++ 代码并试图编译。输出是:

**** Incremental Build of configuration Release for project Programming Project **** Info: Internal Builder is used for build g++ -o "Programming Project.exe" "src\ch_3_excercises.o" c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot open output file Programming Project.exe: Permission denied collect2: ld returned 1 exit status

**** Incremental Build of configuration Release for project Programming Project **** Info: Internal Builder 用于构建 g++ -o "Programming Project.exe" "src\ch_3_excercises.o" c:/mingw/bin/.. /lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe:无法打开输出文件Programming Project.exe:权限被拒绝collect2:ld返回1个退出状态

How can I fix this error?

我该如何解决这个错误?

回答by anon679

All you have to do is go to project on the menu bar and then click clean project. Clean all of your projects and then it should work.

您所要做的就是转到菜单栏上的项目,然后单击清理项目。清理所有项目,然后它应该可以工作。

回答by newbie

I know this is an old question, but it probably does that because you are interrupting the flow of your program, for instance using scanf(), and not actually giving the input it requires, so when you use the command Buildthe project, then eclipse is waiting a stream from your keyboard (for instance, maybe it's a different type of program, but follow me here).

我知道这是一个老问题,但它可能这样做是因为您正在中断程序的流程,例如使用scanf(),而不是实际提供所需的输入,因此当您使用Build该项目的命令时,eclipse 正在等待从您的键盘流式传输(例如,它可能是一种不同类型的程序,但请在此处关注我)。

Once you know than that is the problem, then you might wanna keep an eye in what is that you are not giving to the project and that it is expecting you to; and the way to stop this annoying error the next time you get it, is that in your console view you press the red button.

一旦你知道这是问题所在,那么你可能想要关注你没有给项目提供什么以及它希望你提供什么;下次遇到这个烦人的错误时,停止它的方法是在控制台视图中按下红色按钮。

回答by Elhaw

The same problem with me while editing my code.the easy way i used is ::::::::

我在编辑代码时遇到了同样的问题。我使用的简单方法是 ::::::::

press the red button(Terminate) before editing your code then run your code it is tested and works

在编辑代码之前按红色按钮(终止)然后运行您的代码,它经过测试并有效

回答by Sonic Splasher

Check your quarantine folder of your antivirus. If you see the executable file, then add it to the Trust listor White list. Your problem should be solved.

检查您的防病毒软件的隔离文件夹。如果您看到可执行文件,请将其添加到Trust listWhite list. 你的问题应该得到解决。

回答by Mike Housky

That will happen if the program is still running in another window. The .exe file stays open until the program finishes execution, and you can't delete a file while any processes have it open.

如果程序仍在另一个窗口中运行,就会发生这种情况。.exe 文件在程序完成执行之前一直保持打开状态,并且您无法在任何进程打开文件时删除该文件。

I don't use Eclipse for C/C++ development, and the problem almost can't happen with Code::Blocks, but this happens very often with Visual C++. Just close the other window and rebuild.

我不使用 Eclipse 进行 C/C++ 开发,这个问题几乎不会发生在 Code::Blocks 上,但是在 Visual C++ 中这种情况经常发生。只需关闭另一个窗口并重建。