Permission denied - cannot open outputfile

倖福魔咒の 提交于 2020-01-05 07:06:09

问题


Now and then I get this compilation error when compiling a c-file in Eclipse.

c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot open output file main.exe: Permission denied

It happends when I have made a change in the source-code - but not always.

I know how to solve this* but I would like to know WHY it occurs and how to avoid it?

*In eclipse I go to the debugger and terminate the main thread of the program


回答1:


You said it yourself, it happens because the program being compiled is still running.

In Windows, you can't make changes to the exe file of a program when it's running.

It's fantastically annoying, and one of those things that (to me) make Windows slightly less comfortable than e.g. Linux for development.



来源:https://stackoverflow.com/questions/19855571/permission-denied-cannot-open-outputfile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!