Archived

This topic is now archived and is closed to further replies.

Riskbreaker

Compiling w/o Debug Libraries

Recommended Posts

I don''t really know if this is an issue or not... When you compile a DX program in VC++.NET, I assume it adds in debug libraries to the executable and slows down execution. Is this really true, and if it is, how do you disable compiling with them when you want to deploy your program? Thanks in advance

Share this post


Link to post
Share on other sites
Actually it just links with "export libraries" which load whichever version of the DirectX runtimes are *currently set* when the program is *run*.

If the machine your program is running on only has the retail/release version of DirectX installed, then your program will use that.

If the machine your program is running on has the DirectX SDK on, then which version of the DLLs gets used is determined by the DirectX settings in the Windows control panel. If "Use Debug Version of Direct*" is checked for a component, then the debug version will be loaded when you *run* the program. If instead the setting for a component is "Use Retail Version of Direct*", then the release version will be loaded when you *run* the program.

So really it''s a non-issue - whether the debug or release DLLs are used is decided at run time by the settings for the machine rather than at compile time.


The exception to this however is D3DX. The name of the d3dx .lib file you link with determines if it''s the debug or release version:

D3DX9.LIB = Release/Retail
D3DX9D.LIB = Debug
D3DX9DT.LIB = Debug

You change which libraries get linked in the Linker section of your project settings. Usually you''ll have two configurations when you create a new project: Debug and Release, put the version of D3DX with a D in it in the debug configuration and the version without in the release configuration.
These standard configurations also have some other differences for things like the version of the C runtime library which gets used (debug or release) so it''s worth changing configuration when you want to do a faster release build.

BTW: Although there is a difference between debug and release DLLs, as long as you aren''t creating code which is causing DirectX to spew lots of errors and warnings then there won''t be too much difference (maybe, say 1fps at the most in my experience).

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
This is why I love the forums... thanx so much!

Actually, disabling debug libraries for me increased my frame rate quite a bit... from 9.4 to 14.3 fps.

[edited by - Riskbreaker on May 4, 2003 1:11:32 AM]

Share this post


Link to post
Share on other sites