By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,022 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,022 IT Pros & Developers. It's quick & easy.

Separate Directories for Debug and Release DLLs

P: n/a
Hello,

Is there a way to get Visual Studio 2003 look to one directory for
debug version dlls when set to DEBUG and then to another directory
where I store the release version of a dll when set to RELEASE?

My current project uses about 8 dlls I've written in the past, but I
don't want to keep re-compiling them for debug/release depending on
whether I'm compiling the current project for debug/release.

Thanks in advance,
Tom

Oct 12 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi TBass,
Is there a way to get Visual Studio 2003 look to one directory for
debug version dlls when set to DEBUG and then to another directory
where I store the release version of a dll when set to RELEASE?

My current project uses about 8 dlls I've written in the past, but I
don't want to keep re-compiling them for debug/release depending on
whether I'm compiling the current project for debug/release.
What I do in this situation is to output all release modules which I need
together in one release directory and the same for the debug versions. The
intermediate output files of each project go into a sub directory of the
global release/debug directory named like the project.

So I have an output drive which I name X and there you find this file
structure

x:\release
// here I have *.dll, *.lib, *.exe and *.pdb files of release builds
X:\release\Proj1
// all project output of Proj1
X:\release\Proj2
// all project output of Proj1 and so on

X:\debug
// here I have *.dll, *.lib, *.exe and *.pdb files of debug builds
X:\debug\Proj
// Proj1 output and so on

So if you build an exe into the debug directory and run or debug it, it
should already find all debug dlls it needs.

Does that answer your question or do I miss something?

--
SvenC

Oct 12 '07 #2

P: n/a
[snip]
So if you build an exe into the debug directory and run or debug it, it
should already find all debug dlls it needs.
[/snip]
But how does it find the dll in the release or debug directory?

For example, If I'm working on Proj1, and it needs to utilise the dll
mylib.dll, you would set up:

x:\release
-mylib.dll
-mylib.lib
-mylib.exp
-----+\Proj1
-----+----Proj1.exe
x:\debug
-mylib.dll
-mylib.lib
-mylib.exp
-----+\Proj1
-----+----Proj1.exe

But if I run Proj1.exe, won't I get the error "Proj1.exe could not run
because mylib.dll could not be located." ? Will it find it if it's in
the directory above?

You could add the debug and release versions to the paths in the
configuration, but how would you get it to prioritize on the DEBUG
directory in the debug mode and the RELEASE directory in release mode.
I must be missing something.
Oct 16 '07 #3

P: n/a
TBass wrote:
[snip]
>So if you build an exe into the debug directory and run or debug it, it
should already find all debug dlls it needs.
[/snip]
But how does it find the dll in the release or debug directory?

For example, If I'm working on Proj1, and it needs to utilise the dll
mylib.dll, you would set up:

x:\release
-mylib.dll
-mylib.lib
-mylib.exp
-----+\Proj1
-----+----Proj1.exe
x:\debug
-mylib.dll
-mylib.lib
-mylib.exp
-----+\Proj1
-----+----Proj1.exe

But if I run Proj1.exe, won't I get the error "Proj1.exe could not run
because mylib.dll could not be located." ? Will it find it if it's in
the directory above?

You could add the debug and release versions to the paths in the
configuration, but how would you get it to prioritize on the DEBUG
directory in the debug mode and the RELEASE directory in release mode.
I must be missing something.
TBass:

You want to have the .exe file and the .dll file in the same directory.
If you want, you can use a post-build event in the .exe project to copy
the DLL.

--
David Wilkinson
Visual C++ MVP
Oct 16 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.