Board index » cppbuilder » mysterious linker error - cannot find executable second time I run a program (after no changes)

mysterious linker error - cannot find executable second time I run a program (after no changes)


2007-09-15 01:21:43 AM
cppbuilder15
Hi,
I've been using C++ Builder for years now (I have version 5 these days)
without problems. However, on my laptop the past two days, every new
project I create, I can compile and run it once no problem. Without
changing the code, if I run it again, I get a linker error that says it
cannot find the .exe file. This .exe file that was created in the first run
is still sitting exactly where it should be but the linker cannot find it.
Just as irritatingly, I cannot delete the .exe file unless I reboot the
computer. Fortunately, my desktop is not having these problems, so for the
moment I am okay, but has anyone seen this? I'm at a loss to understand
what happened.
The interesting thing is that old projects that I've been working on for a
while compile and run just as they should with none of these linker issues.
Thanks,
William
 
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

William wrote:
Quote
Just as irritatingly, I cannot delete the .exe file unless I reboot the
computer.
The program is still running.
You likely started a thread and didn't kill it before exiting the app.
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

Hi and thanks for responding.
I had looked at my task manager and every single one leaves when I shut a
program down.
So I went further and created a new project and added not ONE line of code,
ran it once, shut it down, and tried to delete the executable...and it
won't! ??? I can at least compile/run the useless project again, but the
moment I add one single line of code, I get this linker error again.
I also don't understand why the exact same code/project runs on my desktop,
but doesn't on the laptop, and all my old projects continue to work just
fine. Is there some hidden feature that somehow I've changed that is
causing this. Does anyone know where to look?
Thanks,
William
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
William wrote:

>Just as irritatingly, I cannot delete the .exe file unless I reboot the
>computer.

The program is still running.
You likely started a thread and didn't kill it before exiting the app.


 

{smallsort}

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

The symptoms suggest that what Mr Gonder said is correct, the program was
not properly terminated so is still running. This will keep the linker from
creating a different copy of the executable.
Look under Run and find "Program Reset" (control-F2). Click it or press
Control-F2 to stop the program. Program Reset is what version 6 shows but
you are using version 5 so the name is approximate.
. Ed
Quote
William wrote in message
news:46eb2fad$ XXXX@XXXXX.COM ...

Hi and thanks for responding.
I had looked at my task manager and every single one leaves when I shut a
program down.
So I went further and created a new project and added not ONE line of
code, ran it once, shut it down, and tried to delete the executable...and
it won't! ??? I can at least compile/run the useless project again, but
the moment I add one single line of code, I get this linker error again.
I also don't understand why the exact same code/project runs on my
desktop, but doesn't on the laptop, and all my old projects continue to
work just fine. Is there some hidden feature that somehow I've changed
that is causing this. Does anyone know where to look?
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

Again, thanks for commenting. I often have used Control-F2 to shut down
executables where I had some bad programming going on, but the ones I'm
having problems with, now, are definitely shutting down normally (at least
from my viewpoint). Even forcing shutdown by Control-F2 does not change it.
Somehow, some setting must be changed because the default project that opens
up when I create a new one experiences the problems I've described the
moment I add ANY code anywhere.
Forgive me for beating a dead horse, but I can't fathom what's going
on....processes shutdown as usual, none of them shows up in my task manager,
and yet the linker is apparently seeing the situation as if something IS
still running.
Thanks for thinking about this,
William
"Ed Mulroy [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
The symptoms suggest that what Mr Gonder said is correct, the program was
not properly terminated so is still running. This will keep the linker
from creating a different copy of the executable.

Look under Run and find "Program Reset" (control-F2). Click it or press
Control-F2 to stop the program. Program Reset is what version 6 shows but
you are using version 5 so the name is approximate.

. Ed

>William wrote in message
>news:46eb2fad$ XXXX@XXXXX.COM ...
>
>Hi and thanks for responding.
>I had looked at my task manager and every single one leaves when I shut a
>program down.
>So I went further and created a new project and added not ONE line of
>code, ran it once, shut it down, and tried to delete the executable...and
>it won't! ??? I can at least compile/run the useless project again, but
>the moment I add one single line of code, I get this linker error again.
>I also don't understand why the exact same code/project runs on my
>desktop, but doesn't on the laptop, and all my old projects continue to
>work just fine. Is there some hidden feature that somehow I've changed
>that is causing this. Does anyone know where to look?


 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

A couple of things that I would try had I that problem.
- I'd create a program which merely wrote the command line arguments and the
contents of any redirects (command line arguments of the sort @filename) to
the screen and to a log file. I'd then put a copy of that executable in the
project directory renamed to the name of the linker and see what happens.
- I'd search out the file containing the default project info (don't
remember its name offhand) and rename it to hide it, hoping that the IDE
would create a new one without whatever wrinkle is bothering me.
. Ed
Quote
William wrote in message
news:46ec881d$ XXXX@XXXXX.COM ...

Again, thanks for commenting. I often have used Control-F2 to shut down
executables where I had some bad programming going on, but the ones I'm
having problems with, now, are definitely shutting down normally (at least
from my viewpoint). Even forcing shutdown by Control-F2 does not change
it. Somehow, some setting must be changed because the default project that
opens up when I create a new one experiences the problems I've described
the moment I add ANY code anywhere.
Forgive me for beating a dead horse, but I can't fathom what's going
on....processes shutdown as usual, none of them shows up in my task
manager, and yet the linker is apparently seeing the situation as if
something IS still running.
Thanks for thinking about this,
William
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

William wrote:
Quote
I've been using C++ Builder for years now (I have version 5 these days)
However, on my laptop the past two days, every new
What OS are you running on that laptop?
Did your virus protector change?
They tend to protect exe files from changes.
Some might protect from trojan deletion as well.
A simplistic test which might not prove anything...
In your development folder.....
Create a text file with notepad.
Rename the file to something.exe.
Try to delete it.
Another test...
Compile and link the program.
Exit the IDE.
Try two things at this point:
Delete without running.
Run then delete.
If this is normal, then your IDE is messed up.
If not, then your AV/Spyware/OS is messing with you.
Quote
The interesting thing is that old projects that I've been working on for a
while compile and run just as they should with none of these linker issues.
Do these old projects reside in the same folder as the new one?
Maybe there's some funky folder security setting in your OS?
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

As it is a problem when using the IDE the program would need to be a DLL
since the IDE uses a DLL version of the linker.
. Ed
Quote
Ed Mulroy wrote in message
news:46ec96ef$ XXXX@XXXXX.COM ...

A couple of things that I would try had I that problem.

- I'd create a program which merely wrote the command line arguments and
the contents of any redirects (command line arguments of the sort
@filename) to the screen and to a log file. I'd then put a copy of that
executable in the project directory renamed to the name of the linker and
see what happens.

- I'd search out the file containing the default project info (don't
remember its name offhand) and rename it to hide it, hoping that the IDE
would create a new one without whatever wrinkle is bothering me.
 

Re:mysterious linker error - cannot find executable second time I run a program (after no changes)

Haven't gone through all this thread, but, if you haven't...
You might try using sysinternals filemon, to see if the linker actually
tries to access the executable, and if it gets an error doing so.
In the process, you might see errors trying to access some other (presumably
project-) related files that could give you a clue as to what's happening...
You can also use a sysinternals utility to list all open handles (nthandle,
handle.exe). I've used this when trying to find what process may still be
occupying a directory location I want to delete, but it could probably be
used to see if the executable was still open. The version I use (had it for
awhile) is a command-line version, and takes a "-a" switch to list
everything. I redirect output to a file, open it with notepad and search
for (parts of) names I'm interested in knowing about.
"William" < XXXX@XXXXX.COM >wrote in message
Quote
Forgive me for beating a dead horse, but I can't fathom what's going
on....processes shutdown as usual, none of them shows up in my task
manager, and yet the linker is apparently seeing the situation as if
something IS still running.
Thanks for thinking about this,
William