views:

70

answers:

0

I'm using Visual Studio 2005 Pro with SP1 under Windows XP 32 SP3 to build two native EXEs, A and B. A launches B. The following scenario occurs on my development system, which for now is also my test system.

When I link A and B against the debug version of the runtime library, A launches happily but then fails to launch B because the system's loader cannot find the debug version of the runtime library.

I have a theory about why this is so: The debugger has somehow put the debug version of the runtime library into the DLL search path in a way that doesn't propagate into A, so when the loader attempts to resolve B's imports, the debug version of the runtime library cannot be found.

What is the best way to overcome this? Finding the file which contains the debug version of the runtime library and adding its parent directory to the DLL search path seems like the most straightforward approach, but I can't help but wonder why the debugger hasn't done this for me. Perhaps it has a good reason which I should not attempt to second-guess.

If this is the right way to go, how can I avoid hard-coding the full pathname to the relevant directory?

Ideas?