开发者

Visual C++ can't write into exe

开发者 https://www.devze.com 2023-04-07 10:40 出处:网络
after I compiled my project in C++ (VisualStudio) around 3-4开发者_如何学JAVA times, I can do it anymore due to LNK1168 that stands for \"VisualStudio can\'t write into the exe\". I\'ve looked up in m

after I compiled my project in C++ (VisualStudio) around 3-4开发者_如何学JAVA 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 just tells me, that the handle is invalid and though can't be closed. It remains open all the time...


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.

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.

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.


I have been experiencing exactly the same problem (For C# and C++). I have just discovered that having the Application Experience Service disabled seems to cause EXPLORER.EXE To keep .exe files hanging around (locked by the SYSTEM) for several minutes after running that executable.

The solution to this problem, for me at least, was to re-enable the Application Experience service. (I had originally disabled it since it seemed unnecessary - Apparently I was wrong!)


Your exe might still be running. Stop it before recompiling it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号