Reputation: 1
If I compile Test.cpp
with g++ -o Hello_World Test.cpp
, I get Hello_World.exe
. If I run g++ -o Hello_World Test.cpp
again, I get a collect 2 error:
The goal is to compile Test.cpp
into Hello_World.exe
(but two times in a row). Here are my steps:
g++ -o Hello_World Test.cpp
Hello_World.cpp
./Hello_World.cpp
g++ -o Hello_World Test.cpp
Hello_World.cpp
and try to delete it, I get an error saying The action cannot be completed because the file is open in another program
. I tried to use resmon.exe
to see the running .exe
files, and I couldn't figure out what was using Hello_World.exe
, and Hello_World.exe
was not open itself. If I use rm Hello_World.cpp
, I get an error saying I don't have permission.If anyone has an idea as to what might be happening, I would greatly appreciate it.
Upvotes: 0
Views: 94
Reputation: 4091
If anyone has an idea as to what might be happening, I would greatly appreciate it.
Well it’s simple. The application is running in the background. You can check your TaskManager and kill it from there.
What exactly causes the application to keep running in the background will need more investigation to find out.
The most common reason this happens in Sublime is when you are running an interactive application. Sublime doesn’t forward any input that you type into the output panel to your running program, so it’s effectively hung forever in the background waiting for input you can’t provide.
Upvotes: 1