LNK1168: cannot open debug\file.exe for writing LNK1168: cannot open debug\file.exe for writing windows windows

LNK1168: cannot open debug\file.exe for writing


  1. Go to the task manager Ctrl+Alt+Del.
  2. look for the name of your running application in your case GettingStarted.exe.
  3. right click --> end process or just press Suppr . This will kill the running process.
  4. Go back to your code and run the application again


In my simple case (Qt only, no external libs, same error LNK1168) the Task manager showed nothing useful to kill. Only total reboot has helped and error is gone.


All the methods mentioned here has not helped except reboot. There is no any ProjectName.exe in Task Manager.
You can go to C:\Users\user-name\source\repos\ProjectName\Debug\ folder and rename ProjectName.exe. You can't delete this file at that time, but It can be renamed. It can only be deleted after reboot.