d3dx9_28.dll not found!

Do you like these nice dll-not-found surprises as much as me, when running your self created games on other PCs? Like
The application could not be started, because d3dx9_28.dll
was not found. Reinstalling could remove the problem.
Of course, reinstalling won't change anything. The reason for this is that in 2005, Microsoft has moved the D3DX library from a static linked lib to a dynamic linked dll. Every time they release a new version (almost every two months), they increase the version number and the name of the dll is different (d3dx9_24.dll, d3dx9_25.dll, d3dx9_26.dll, d3dx9_27.dll, ...). The problem now is that end users usually don't update their DirectX version every 2 months. Totally understandable. But usually, developers do, and so the program won't run on the end users system without a DirectX update. Ok, Dlls do have a lot of advantages but in my opinion, Microsoft really made a bad decision here. For example, just search for d3dx9_26.dll and see how many users have a problem with that. Most applications or their installers could provide this dll too, but in fact, most don't do this, and IMO it should also not be their buisness to do that.
Maybe you also have noticed that Irrlicht doesn't suffer from this problem. Why? Because I simply compile Irrlicht with an old SDK version which still has a staticly linkable D3DX version. But this isn't a good solution if you want to use newer versions of the DirectX SDK. How do other 3D engines solve this? Most engines simply don't. They simply won't run without all dlls installed and produce that nice senseless 'resinstall might solve the problem' message box. Others use a plugin-approach: They implement each renderer in an own dll and load it when needed. If for example the d3d renderer doesn't load because the dependency to a d3dx9_xx.dll could not be resolved, they simply don't run with the d3d renderer. But both approaches are not an option for Irrlicht. First because I want Irrlicht to start up always, independent of what the user has installed on his system, and second because I don't want Irrlicht to use plugins, everything should be compiled into one single, small dll.
But this morning, I checked in an Irrlicht version with runs with every version of D3D and independent of what the user has installed on its system. How do I achieve this? Irrlicht now simply tries to load all external dlls manually, like it did this with the standard d3d dlls before too. If you are missing the expected d3dx9_xx.dll, it simply disables the features needed from there, which in this case only is shader support, everything else like mipmap generation is implemented in Irrlicht itself and doesn't rely on D3DX. This also has some other advantages: Irrlicht won't load these unecessary dlls if you don't use their features in your program, increasing startup time a bit. Yay, I really like it now.

six comments, already:

circumventing m$ features with dll madness, nice to see that
terefang - 30 12 05 - 12:39

Hmm, but what if the user wants shadersupport and would rather get and error that running without shaders and not knowing what’s going on?
Matthias - 30 12 05 - 13:44

I think that whoever is making a game/renderer with irrlicht should just provide an option to install the latest version of the D3DX dll in the installer for their app. What version of the d3dx9_xx.dll is irrlicht using now anyways?
Andrew - 30 12 05 - 21:31

I think it depens on what library YOU have installed and have linked with Irrlicht.
bal - 31 12 05 - 09:26

I think it’s always better to make your program run then letting windows abord it with this nice message box. You can check for example the log message or the return code of the shader creation method, and then inform the user displaying a message, whatever you want.
And the precompiled version of Irrlicht is currently using no d3dx9_xx.dll, as mentioned in the text above.
niko - 31 12 05 - 17:11

sometime in like June, Microsoft realized this problem and made a new installer to install the latest libraries for end users (updating each time they release a new SDK)

I’ll see if I can figure out where I put that link.
The Anaconda - 31 12 05 - 22:35


Displayed name:  
Remember personal info?
yes
no
Website (optional):
Enter "layered" (antispam):
Comment:Emoticons / Textile

 


Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.
Note: If you type in your email adress above, it will be visible to other visitors, although it will be hidden for bots using javaScript.