Permission Denied Error

Hey,
I'm new to C++ and keep getting an error i wondered anyone could help with.

I get a permission denied and id returned 1 exit status, the code is fine and as far as i understand this would be because my OS doesn't allow modification of currently running files which would make sense as when i look in task manager it shows my program running even though it has finished. Ending process/process tree does nothing as does using any third party process terminator.

There is no loop in the program or anything even a simple hello world program yields the same result. Only way i can re-run my program is restarting my computer or saving the project under another name and re-compiling

Any help would be appreciated :)
Last edited on
The most common cause of this problem is a debugger that's attached to the program.
Last edited on
Ah right i have noticed a devcpp process running in the background that i cant terminate either been trying to find a way to disable the debugger but just get info on disabling the debuggers output. Any ideas on how to disable it? closing the compiler doesn't work either as the process that keeps the file in use still runs in the background.
To kill the process from an elevated command prompt run taskkill /IM devcpp.exe /T . This will send a "Terminate Process" command which is not handled by the running process and so it should always remove the image from memory. There are only a small minority of cases where this does not work, in which case my suggestion would be to use a different IDE.
Just detaching the debugger or stopping the debuggee from the debugger should be enough to release the process most times. It only doesn't work when the process is hanged very hard, so to speak.
Topic archived. No new replies allowed.