DirectX DLL Hell...

Started by
8 comments, last by Evil Steve 12 years, 9 months ago
Hi all,
Can anyone help me?

I've just moved my whole development to a new computer... where the first time I compiled and ran one of my programs, it told me that D3DX9_42.dll was not found. After some googling, I see that Microsoft has dumped this dll in favor of D3DX9_43.dll. I could just grab the dll, but when my end-users install the game on their computer, I do NOT want them to have to take this extra step.

Does anyone know where I can find a copy of D3DX9.lib that links to a version of the dll that Microsoft is still distributing? (It looks like either D3DX9_43.dll or D3DX9_39 are still in the DirectX package).

I've been googling a couple hours here, and all I can find are bogus sites or linkfarms... or links to D3DX9C, which is the one I have that has the bad linking lib.

Thanks in advance!
John
Advertisement
Download and install the latest version of the DirectX SDK and recompile.

Also, make sure you have the latest DirectX installed.

Download and install the latest version of the DirectX SDK and recompile.


My issue is, I have just got a new computer-- this will be the condition that many of my end-users will be in-- pre-installed with the latest directX, but not containing that dll.
I do not want to have to tell them "and don't forget to download an obscure dll, and put it in an obscure place before you can play!" I never had to do that with DirectX7, and it seems I should be able to find a version of d3dx9.lib that links to a dll that Microsoft is still distributing, no?

I want their experience to be "download game, install, play."

No, I don't want to include a DirectX runtime install in my build. There's no reason at all for me to have to do this-- I haven't had to do it in the past, I only have to do it by upgrading the technology? My alternative is going to be to discontinue using d3dx, but then it's probably going to take me an entire day to write a texture loading function.
That's the only legal option with newer d3dx libraries - either stop using d3dx, or include redistributable of DirectX in your setup. You can make it very small in size by including only those components you actually use:
http://msdn.microsoft.com/en-us/library/ee416805(v=vs.85).aspx#ID4EYF

You can also instruct Visual Studio to use d3dx dll file with delay loading. In that case you will be able to start application even if the dll file is missing. Then check presence of needed dll file, and display user-friendly message about the proble, if it is not found (Please install latest DirectX redist... from URL: ...).


My alternative is going to be to discontinue using d3dx, but then it's probably going to take me an entire day to write a texture loading function.

If you care only about png/jpg/bmp/tga, then use stb_image.c. That's only one C source file that can load all those formats with one simple function call.
Just use an older DirectX SDK - last time I checked, MS still had SDKs going back to 2005 or so available for download, so grab one of those (you may need to search around a bit on their downloads site to find it) and link against it. Problem solved.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Well... I think I'll try to eradicate D3DX from my code first. I only use it in a few places... mostly for loading textures. I'll get around that.

Thanks for the help!
Also consider that if you just direct your users to the DX9 end-user web installer, it'll install the D3DX dlls that are missing from their machine.

Just use an older DirectX SDK - last time I checked, MS still had SDKs going back to 2005 or so available for download, so grab one of those (you may need to search around a bit on their downloads site to find it) and link against it. Problem solved.
The last SDK that static linked to the D3DX libraries was something like December 2004 (Possibly earlier, but it was definitely December some year). And a version that old won't be compatible with the current SDK, meaning you'll need to change a bunch of code to get it to work, and the older versions have pretty terrible performance and security issues in them.

The best way, the way that everyone else does, is to just bundle the DirectX redistributable with your app. Then it'll install the version of the D3DX libraries you need.
With GLUT i just link the libraries into my executable statically. -I can imagine that this is a dangerous task with DX, but off the top of my head, that's what I'd take a look at.

With GLUT i just link the libraries into my executable statically. -I can imagine that this is a dangerous task with DX, but off the top of my head, that's what I'd take a look at.
The D3DX libraries don't have a static version of the library, for security reasons (A DLL can be patched via Windows Update, code linked into an executable can't).

This topic is closed to new replies.

Advertisement