I have qt project but if I edit my code, Qt creator throws out this error

:-1: error: LNK1168: cannot open debug\GettingStarted.exe for writing

I'm not able even to delete the debug folder (i.e. as an administrator). I have to log off and then come back. What is the problem and how can I solve it?

asked Jul 24 '15 at 1:55

4

  • Is the program still running? Is it open in a debugger?

    Jul 24 '15 at 2:14

  • @RaymondChen, yes indeed but I don't know why this occurs? I'm trying to open cam with OpenCV. Once I quit the app, it seems something is running in the background.

    Jul 24 '15 at 16:17

  • Maybe you can use Task Manager to see what extra stuff is running (compared to what is running before you build and debug).

    Jul 24 '15 at 16:50

3 Answers 3

  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

eyllanesc

210k 15 gold badges 103 silver badges 171 bronze badges

answered Jan 21 '16 at 1:38

1

  • If you can't find your *.exe in the Processes tab of the Task Manager, then search in the Details tab

    Feb 1 at 8:57

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.

answered Oct 30 '19 at 22:11

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.

answered Oct 6 at 18:13

Not the answer you're looking for? Browse other questions tagged c++ windows qt-creator qt5 or ask your own question.