简体   繁体   English

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

[英]Eclipse C/C++ “Permission Denied” error

I'm using Eclipse Helios in Windows7 for C/C++ programming.我在 Windows7 中使用 Eclipse Helios 进行 C/C++ 编程。 I wrote a basic C++ code and tried to compile.我写了一个基本的 C++ 代码并试图编译。 The output is:输出是:

**** 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 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:无法打开输出文件Programming Project.exe:权限被拒绝collect2:ld返回1个退出状态

How can I fix this error?我该如何解决这个错误?

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.清理所有项目,然后它应该可以工作。

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在编辑代码之前按红色按钮(终止)然后运行您的代码,它经过测试并可以工作

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 Build the 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 the project 时,然后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.下次遇到这个烦人的错误时,停止它的方法是在控制台视图中按下红色按钮。

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++.我不使用 Eclipse 进行 C/C++ 开发,这个问题几乎不会发生在 Code::Blocks 上,但是在 Visual C++ 中这种情况经常发生。 Just close the other window and rebuild.只需关闭另一个窗口并重建。

Check your quarantine folder of your antivirus.检查您的防病毒软件的隔离文件夹。 If you see the executable file, then add it to the Trust list or White list .如果您看到可执行文件,请将其添加到Trust listWhite list Your problem should be solved.你的问题应该得到解决。

It means the same .exe file is running in your system.这意味着您的系统中正在运行相同的 .exe 文件。 A program cannot be build when its already running.程序在运行时无法构建。 So the simple and most obvious thing to do is:-所以最简单和最明显的事情是:-

  1. Open task manager打开任务管理器
  2. Find <yourfilename.exe> under processes在进程下找到 <yourfilename.exe>
  3. Right click and end task右键单击并结束任务

This stops it from running in background.这会阻止它在后台运行。 So you can build your program anew and run.所以你可以重新构建你的程序并运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM