无法打开输出文件,拒绝权限 [英] Cannot open output file, permission denied

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

问题描述

所以当试图使用CodeBlocks编译C ++代码时,我一直收到这个错误。

So I keep getting this error when trying to compile C++ code using CodeBlocks.

无法打开输出文件[filename.exe]已拒绝

cannot open output file [filename.exe] permission denied

它只是从今天开始,它是零星和不一致。它通常会消失,如果我关闭CodeBlocks和重新启动项目,但不总是。有时甚至会消失,当我只是按F9(构建&运行)几次。我总是检查任务管理器,但从来没有任何运行与我的文件的名称或任何相关的.EXE。

It only started today, and it's sporadic and inconsistent. It usually goes away if I shut CodeBlocks down and restart the project, but not always. Sometimes it even goes away when I just press F9 (build & run) several times. I always check Task Manager, but there are never any .EXEs running with my file's name, or anything related to it.

我也注意到,如果这个问题发生,然后我尝试手动删除.EXE或以其他方式与它交互,Windows告诉我,我需要管理员权限所以(这是一个私人电脑,据我所知我是一个管理员)。

I've also noticed that if this problem occurs and I then try to delete the .EXE manually or otherwise interact with it, Windows tells me I need administrator permission to do so (this is a private PC, and as far as I know I am an administrator on it).

第一次发生时,我添加的唯一的东西超出了以前版本的代码是一个调试报告发送到cout - 几乎没有什么奥术。即使没有从以前的版本更改任何代码,它有时也会出现。

The first time it occurred, the only thing I had added to the code beyond what was in the previous version was a debugging report sent to cout - hardly anything arcane. It sometimes occurs even when no code was changed from a previous version.

这是什么?这不是破坏性的,但是,它是刺激性的,我宁愿它不会变得更糟。

What could this be? It's not game-breaking, yet, but it's irritating and I'd rather it didn't get worse.

编辑:这是老的现在,但只是为了任何人都有类似的问题,我目前使用的解决方法只是一致删除[filename.exe],然后再次运行代码。

This is old by now, but just in case anyone else is having similar problems, the workaround I currently use is just to consistently delete [filename.exe] before trying to run the code again. This avoids the problem, though it is annoying.

推荐答案

检查filename.exe没有运行,我想你是使用Microsoft Windows,在这种情况下,您可以使用任务管理器或进程资源管理器: http://technet.microsoft.com / en-us / sysinternals / bb896653 杀死filename.exe,然后尝试生成它。

check that "filename.exe" is not running, I guess you are using Microsoft Windows, in that case you can use either Task Manager or Process Explorer : http://technet.microsoft.com/en-us/sysinternals/bb896653 to kill "filename.exe" before trying to generate it.

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

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