Sign in to follow this  
JohnRaptis

DirectX DLL Hell...

Recommended Posts

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

Share this post


Link to post
Share on other sites
[quote name='jamesleighe' timestamp='1310398153' post='4833767']
Download and install the latest version of the DirectX SDK and recompile.
[/quote]

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.

Share this post


Link to post
Share on other sites
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:
[url]http://msdn.microsoft.com/en-us/library/ee416805(v=vs.85).aspx#ID4EYF[/url]

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: ...).


[quote name='JohnnyLightwave' timestamp='1310398722' post='4833778']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.
[/quote]
If you care only about png/jpg/bmp/tga, then use [url=http://nothings.org/stb_image.c]stb_image.c[/url]. That's only one C source file that can load all those formats with one simple function call.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Also consider that if you just direct your users to the [url="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=35"]DX9 end-user web installer[/url], it'll install the D3DX dlls that are missing from their machine.

Share this post


Link to post
Share on other sites
[quote name='mhagain' timestamp='1310404823' post='4833842']
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.
[/quote]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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote name='SuperVGA' timestamp='1310471542' post='4834255']
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.
[/quote]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).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this