VC++ fatal error LNK1168: cannot open filename.exe

2019-01-08 18:34发布

suddenly my visual studio express 2010 c++ stopped rebuilding my project.
When I first hit F7 the project builds and runs fine (heck, it's a hello world example).
Then I make some changes and hit F7 again, then I get:
1>LINK : fatal error LNK1168: cannot open C:\Users\username\Documents\Visual Studio 2010\Projects\console\Debug\console.exe for writing

Now the funny thing comes:

  1. the app is not running and it's not shown in task manager.
  2. going into the project directory and trying to remove it with hands comes with success but the file APPEARS AGAIN FROM NOWHERE o_O
  3. the system restore is disabled
  4. i also tried to take the ownership of the whole damn drive
  5. each time I delete the file it recreates itself again but sometimes it stops doing that
  6. if delete the file (and it recreates after that) and then I start sysinternals procmon then the file will dissapear.
  7. if I start procmon before - then the file keeps appearing after delete like always

OS: W7 SP1 64-bit, with latest updates
any ideas, please? google didn't help me :(

8条回答
一夜七次
2楼-- · 2019-01-08 18:51

well, I actually just saved and closed the project and restarted VS Express 2013 in windows 8 and that sorted my problem.

查看更多
Anthone
3楼-- · 2019-01-08 18:56

Enable “Application Experience” service. Launch a console window and type net start AeLookupSvc

查看更多
beautiful°
4楼-- · 2019-01-08 18:56

The problem is probably that you forgot to close the program and that you instead have the program running in the background.

Find the console window where the exe file program is running, and close it by clicking the X in the upper right corner. Then try to recompile the program. In my case this solved the problem.

I know this posting is old, but I am answering for the other people like me who find this through the search engines.

查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-08 18:57

I also had this same issue. My console window was no longer open, but I was able to see my application running by going to processes within task manager. The process name was the name of my application. Once I ended the process I was able to build and compile my code with no issues.

查看更多
Juvenile、少年°
6楼-- · 2019-01-08 18:59

In my case, cleaning and rebuilding the project resolved the problem.

查看更多
beautiful°
7楼-- · 2019-01-08 19:01

Start your program as administrator it cant rewrite your files cause your files are ine protected location on your disc.

查看更多
登录 后发表回答