OK .. I checked that tool ..
I reboot, clean machine, I create a new file, test.c.
I build and run, program compiles and runs successfully, terminal window is open (I don't close it yet).
I open up built-in Resource Monitor -
screenshot here.
I see the process cb_console_runner.exe (pid=15172). Searching through handles, i see multiple entries, all same PID. To be honest, I can't fully understand handles 'do'.. All have same PID so it's sort of different references to the same process in different parts of the OS?
By the way, task manager obviously shows same process (same id of course, although i did not capture it with screenshot) -
screenshot here.
Now, I close the terminal window, and as expected the process disappears from task manager, and in Resource Monitor it shows as 'terminated' (
screenshot here - also grayed out, disabled) and when I click on the processes window, it kind of 'refreshes' and the process completely disappears from the processes list. Sorting with PIDs, there is no process with pid 15172 anymore. I can't see anything on bottom window with 'handles' either..
Now, I try to build & run again, only to get the same error:
-------------- Build file: "no target" in "no project" (compiler: unknown)---------------
gcc.exe -c C:\Users\thomas\test.c -o C:\Users\thomas\test.o
gcc.exe -o C:\Users\thomas\test.exe C:\Users\thomas\test.o
C:/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file C:\Users\thomas\test.exe: Invalid argument
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Interestingly, I try to manually delete .exe file, and I get "action can't be completed because the file is open in another program".
I close CodeBlocks (just in case) - same message, action can't be completed...
In the past, I could delete .exe files manually ...
Also - irrelevant probabaly - but I performed a CHKDSK on windows, it found that it needed to fix some errors, rebooted, performed thorough CHKDSK, it said it fixed stuff, nothing changed ..
I am searching on how to find that 'other program' that holds a lock on the .exe file - but everything points to checking task manager, killing the process etc - but I cant find any process that deals with it once the terminal window is closed. Process Monitor has no handles on previous PID 15172 ... all processes seem legit and irrelevant to that previous executable ...
I 'm lost... any ideas would be greatly appreciated ...