I have an error which started showing up only a few days ago. I'm running Windows 7 Professional x64 bit.
I have a .cpp file, and I use the command prompt to run the following command:
g++ -std=c++11 A.cpp
It creates the executable, a.exe. However if I run the same command again immediately, I get this error:-
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot
open output file a.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
If I try to delete the executable, I get "You need permission to perform this action" (I'm using an Administrator account). Under the security tab in properties, it says "Unable to display current owner." If I try to change it's ownership, I get "Unable to set a new owner on a.exe. Access is denied."
Furthermore, if I try to open the file, it says "Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item."
Strangest of all, after about a minute the file then automatically disappears.
None of these happen if I run the compile command just once. If I run it once, I can delete the executable, run it, and the owner displays my account name. The file also doesn't disappear.
Please help me with this, it's very annoying. I tried with my anti virus (Kasperksy Internet Security) turned off, and this still happens.