Direct3D Programming Tip #6: Link Against The Debug D3DX

Just as important as using the Direct3D debug runtime is using the debug D3DX library. D3DX is provided as a DLL library and like the runtime it is provided in two versions: release and debug builds.

Many times in discussion forums and newsgroups, people report having a problem with a D3DX function that fails with “no debug messages”. The key to understanding the failure is to link with the debug version of D3DX so that diagnostic information will be written to the debug output stream.

To link against the debug D3DX, use d3dx9d.lib (or d3dx10d.lib) as the linker input for D3DX in a debug build of your code. Don’t add the debug library to your release build. Just like the core runtime, the debug libraries are only available if you install the DirectX SDK. When you ship your application to users, the debug D3DX will not be available on their machine and your application will fail to launch if you link against the debug D3DX in your Release configuration.

If you use the SlimDX managed layer for DirectX and are having problems with some functionality that ultimately lies within D3DX, you might want to consider building your own debug version of the SlimDX assemblies that links against the debug D3DX in order to debug the problem.

kick it on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: