权限被拒绝-无法打开输出文件 [英] Permission denied - cannot open outputfile

查看:156
本文介绍了权限被拒绝-无法打开输出文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,然后在Eclipse中编译c文件时出现此编译错误.

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:无法打开输出文件main.exe:权限被拒绝

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?

* 在Eclipse中,我进入调试器并终止程序的主线程

推荐答案

您自己说了这是因为正在编译的程序仍在运行.

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

在Windows中,您无法在程序运行时对其exe文件进行更改.

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

这真是令人讨厌,而且(对我而言)使Windows舒适度比诸如此类的东西之一.Linux用于开发.

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

这篇关于权限被拒绝-无法打开输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆