469,572 Members | 1,325 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

Separate Directories for Debug and Release DLLs

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
3 1757
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
[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
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.

Similar topics

6 posts views Thread by ss | last post: by
reply views Thread by Dave | last post: by
1 post views Thread by moshehaim1 | last post: by
6 posts views Thread by =?Utf-8?B?RmFiaWFu?= | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.