Visual C ++无法写入exe [英] Visual C++ can't write into exe

查看:152
本文介绍了Visual C ++无法写入exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++(VisualStudio)中编译项目大约3-4次后,由于LNK1168代表"VisualStudio无法写入exe",因此我可以继续执行此操作.我在TaskManager中查找了该exe文件未运行.通常,我必须等待5分钟左右,但这并不是真正的解决方案.有什么想法吗?

after I compiled my project in C++ (VisualStudio) around 3-4 times, I can do it anymore due to LNK1168 that stands for "VisualStudio can't write into the exe". I've looked up in my TaskManager, the exe is NOT running. Normally I have to wait for like 5 minutes but that isn't a real solution. Any ideas?

ProcessExplorer只是告诉我,该句柄无效,尽管无法关闭.它一直保持打开状态...

ProcessExplorer just tells me, that the handle is invalid and though can't be closed. It remains open all the time...

推荐答案

首先想到的是使用 ProcessExplorer 来确定哪个进程正在使文件保持打开状态.下载并启动该工具,然后从菜单中选择查找.输入(部分)文件名,它应显示在搜索结果中.双击以跳到主应用程序窗口中的进程和文件句柄. 我猜想Visual Studio是元凶.

First thing that comes to mind is to use ProcessExplorer to figure out what process is keeping the file open. Download and start up the tool en select Find from the menu. Enter the (partial) file name and it should show up in the search results. Double click to jump to the process and file handle in the main application window. I'm guessing Visual Studio is the culprit.

幸运的是,您还可以使用Process Explorer关闭该句柄.右键单击并选择关闭句柄.

Fortunately, you can also use Process Explorer to close the handle. Right-click and choose Close Handle.

请注意,定期关闭文件句柄并不是一个好主意.但是,每当您泡菜时,它确实可以帮助解决烦人的问题.

Note that it's not a good idea to go around closing file handles on a regular basis. However, whenever you're in a pickle it can really help solve annoying problems.

如果我没记错的话,VS 6中也存在类似的问题.这与增量编译有关.对于更具结构性的解决方案,请尝试不时进行完全重建,或者一起禁用增量编译.

If I recall correctly, a similar problem existed way back in VS 6. It had to do with incremental compilation. For a more structural solution, try doing a full rebuild from time to time or disabling incremental compilation all together.

这篇关于Visual C ++无法写入exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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