suggestion : IrrlichD.lib / IrrlichtD.dll

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
stephaneR
Posts: 12
Joined: Fri Mar 28, 2008 9:10 pm

suggestion : IrrlichD.lib / IrrlichtD.dll

Post by stephaneR »

hello,

I just compiled Irrlicht for the 1st time (from the trunk) and I'm used to output my debug dlls/libs with a 'D' for the debug version.
So why not naming the debug versions with a D to be able to have both debug and release version in the same folder ?
I will do it locally, but it will be nice to have it in the official build.

Stephane
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: suggestion : IrrlichD.lib / IrrlichtD.dll

Post by randomMesh »

Yeah, good idea. That is how wxWidgets does it, too.
tonic
Posts: 69
Joined: Mon Dec 10, 2007 6:18 pm
Contact:

Post by tonic »

I agree. I have also done this modification locally...
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Me too.

[Trivia: the 3rd page of Google image results for "me too" in moderately safe mode throws up an Alyson Hannigan hit]
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

rogerborg wrote:Me too.

[Trivia: the 3rd page of Google image results for "me too" in moderately safe mode throws up an Alyson Hannigan hit]
Wow, rofl. (You search for some weird things! :D )
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

If you have both Irrlicht's dll, IrrlichtD.dll and Irrlicht.dll. When you compile your app using Debug build/Release build, how can it use the appropriate dll?

P.S
If there is a simple way I think I'll do that too.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
stephaneR
Posts: 12
Joined: Fri Mar 28, 2008 9:10 pm

Post by stephaneR »

MasterGod wrote:If you have both Irrlicht's dll, IrrlichtD.dll and Irrlicht.dll. When you compile your app using Debug build/Release build, how can it use the appropriate dll?
if you link with irrlichtD.lib, irrlichtD.dll will be used
so, in your code :

Code: Select all

#ifdef _DEBUG
#pragma comment(lib, "IrrlichtD.lib")
#else
#pragma comment(lib, "Irrlicht.lib")
#endif

Stephane
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

stephaneR wrote:
MasterGod wrote:If you have both Irrlicht's dll, IrrlichtD.dll and Irrlicht.dll. When you compile your app using Debug build/Release build, how can it use the appropriate dll?
if you link with irrlichtD.lib, irrlichtD.dll will be used
so, in your code :

Code: Select all

#ifdef _DEBUG
#pragma comment(lib, "IrrlichtD.lib")
#else
#pragma comment(lib, "Irrlicht.lib")
#endif

Stephane
Thanks!

Good idea that 'D' thing, thanks for mentioning :P .
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

Yeah, I always liked doing that.
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Errr, if this will be kept in the MSVC projects only you can do whatever you want :? What if you want to debug your app, but not the library? Just create several libraries in different directories and set the lib path properly (or copy the dll to your app's directory if your OS doesn't have an LD_LIBRARY_PATH)
stephaneR
Posts: 12
Joined: Fri Mar 28, 2008 9:10 pm

Post by stephaneR »

hybrid wrote:What if you want to debug your app, but not the library?
removing the generated irrlichtD.pdb will remove the ability to trace into the debug irrlicht dll.
but i always prefer to have everything in debug, so I can trace into the external libraries (i.e. not my code) if something goes wrong.

ex (during dev phase) :

Code: Select all

bool MyFunction()
{
   if ( externalLib->DoSomething() == false )
   {
       //something went wrong
#ifdef _DEBUG
       //redo the call to trace into it.
       bool retval = externalLib->DoSomething(); //put a breakpoint here to trace into the external lib
#endif
       return false;
   }
   return true;
}
And I don't really see the advantages of using the release dll in a debug build (IMHO speed issues should only be tested in release, never in debug).
I already had some crazy hours searching a bug when I was linking/using the wrong .lib/.dll. So now I take care of my generated dlls.
And in case I want to be able to trace into a release build, sometimes I also add a "Release with debug info" build configuration

to sum up, usually i have :
<lib>.dll : release dll
<lib>D.dll : debug dll

if i generate static libs :
<lib>S.lib : static release
<lib>SD.lib : static debug

sometimes even more, depending on the projects and needs.
(multithread, multithread dll, release with debug info, etc... )

Stephane
aheymann
Posts: 153
Joined: Wed Aug 22, 2007 12:25 pm
Location: England

Post by aheymann »

Hallo

I find that actually using seperate folders for debug and release code is the way to go. In many instances you rely on other external libraries as well (both release and debug versions of those). Might it not be better to keep the DLL's named the same, but place them in a Debug or Release folder (you might extend this include other types of builds as well). Using this method, you can keep your debug and release builds completely isolated.

Anton
Post Reply