473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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 1954
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DE | last post by:
Hello, I have a problem with python builds since some time. On windows, it is not a good idea to link your debug build to release builds of libs and dlls. But python installer gives you...
2
by: nfr | last post by:
Default build directories seem to be somewhat different between C# and Visual Basic.NET. Both have "Debug" and "Release" directories under "obj". However, Visual Studio.NET defaults to a single...
6
by: ss | last post by:
Hi I built an exe in console debug mode & Release mode . The console debug mode -exe works fine ...but the release mode EXE starts well but fails mid way . The exe is being started as a...
2
by: Beeeeeves | last post by:
Why whenever I create a project in c#, when I compile it, it has got the resulting executable TWICE in TWO different directories - obj\debug and bin\debug. WHY? Sometimes when I'm trying to debug...
2
by: babyx | last post by:
The release build class library can only work with msvcr71d.dll and msvcp71d.dll exist. How to make this class library work on any machine without using the debug dlls? What are the project...
0
by: Dave | last post by:
I've been developing lately with the Microsoft Application Data Blocks. When you use the default project after you install, it compiles debug and release mode dll's for you. How can I set up my...
4
by: =?Utf-8?B?QldC?= | last post by:
We have a mixed application that includes managed and unmanaged code. Until recently we've been able to remote debug by disabling the security policy to get the MFC managed dlls to load properly...
1
by: moshehaim1 | last post by:
Hi, I am working with C++ code that needs to be maintained both in debug and release versions. The environment is Windows 32 bit with MSVC8. I downloaded the python installation for Win32 and...
6
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hi, I have a pretty complicated program which consists of the following basic modules: 1. a C# application 2. a C++/CLI application which is controlled by the C# app via IPC remoting 3. lots...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.