Jump to content
  • Advertisement
Sign in to follow this  
Paul65

DirectX 11 not compatible with DirectX 9?

This topic is 2601 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wrote a program using DirectX 9 but when run on a PC with DirectX 11 it comes up with an error message saying that d3dx9_40.dll is not found. Installing DirectX 9 will solve this problem but surely it should be able to write a program on 9 that runs on 11? I don't want to be sending out my program to people with instructions to install an extra version of DirectX.

Share this post


Link to post
Share on other sites
Advertisement
DirectX10+11 run-times already comes installed on windows7. DirectX10 comes already installed on Vista. Unfortunately, DirectX9 don't comes already installed on any Windows machine. To make things worse, there's over 40 different version of the dll. Usually a game on DVD comes bundled with "directx redistributables" that install the necessary run-times at the end of the game installation if needed. Note that it's also the case with Microsoft Visual C++ redistributables, XNA and .NET framework.

Share this post


Link to post
Share on other sites
You do not install DirectX on any version of Windows, assuming you're targeting XP SP2 at a minimum (which you should, because anything lower than that is crazy). What you do need to install is the DirectX Runtime DLL's, if you use any of the D3DX helper libraries. This is done by running DXSETUP on the end-user's machine (you can launch it from an installer), which is found in the Redistributable folder of your SDK install folder. Or you can also have the end-user run the web installer.

Share this post


Link to post
Share on other sites
OK, here's the way it goes.

DirectX 9 was originally releaed sometime 2002-ish. Since then it has recieved many updates, sometimes quarterly, sometimes bi-monthly.

Roundabout 2005/2006 the D3DX stuff switched from being statically linked to being dynamically linked. That's about when the d3dx_NN DLLs started appearing.

Both Vista and 7 actually do ship with D3D9 (and 8, for that matter), but they ship with an older version of it. One that does not include a fully up to date series of d3dx_NN DLLs. In the case of Windows 7 it's a coupla years out of date.

If you compile with an SDK more recent than the most recent d3dx_NN that is on your Windows install, this will happen. This is actually nothing to do with Windows Vista or 7, and nothing to do with D3D10 or 11; you can fully reproduce it on XP too. Just build a fresh XP box with D3D9 runtimes from a coupla years ago, then try to run a program compiled against the latest (or any later) SDK on it and you'll get the same.

So the solution is to update your DirectX.

It's about here that people might start thinking along the lines of "I already have D3D11, doesn't that include D3D9?" or "will updating my D3D9 break my D3D11?" The answer to both is "no".

Each new D3D major version does not include all functionality from all previous major versions; in this case the version numbering is playing a small trick on you. It's not a more recent take on the previous major version, it's something new and different. It's a different set of DLLs, and updating your D3D9 will only update the D3D9 DLLs. The DirectX runtime updates from Microsoft do include updates to all versions (within reason - you won't get an update for DirectX 3 for example) on your machine. But you need to think of each DirectX major version as actually being completely different from and separated from preceding major versions.

An alternative solution is to dynamically load the D3DX stuff from your program (using LoadLibrary and GetProcAddress on the nighest numbered d3dx_NN you can find) but I'd be extremely wary of breaking changes between different versions of these (the shader compiler is one I know of for certain, there might be others).

Whatever else you do, don't grab the missing DLL from some download site. Use the proper DirectX updater from Microsoft instead; that way you know that you're getting the Real Thing and you know that you're definitely not letting any Unexpected Guests in the back door, if you know what I mean.

Share this post


Link to post
Share on other sites
Okay, so I need to put DXSETUP into my install. I'm using inno setup 5 for installing my program so I assume what I've got to do is run DXSETUP.EXE at the end of my main install. How does it know which version of directx to use? Do I just put the .cab files for my version in the same path used by the dxsetup? (I need the November 2008 release).

Share this post


Link to post
Share on other sites

DirectX10+11 run-times already comes installed on windows7. DirectX10 comes already installed on Vista. Unfortunately, DirectX9 don't comes already installed on any Windows machine. To make things worse, there's over 40 different version of the dll. Usually a game on DVD comes bundled with "directx redistributables" that install the necessary run-times at the end of the game installation if needed. Note that it's also the case with Microsoft Visual C++ redistributables, XNA and .NET framework.



Thats not true since WinXP SP2 DX9.0c is preinstalled, the different dll versions are actually D3DX and if you don't use any of the D3DX functions the applicationwill work fine without the need to install any DX stuff.

Share this post


Link to post
Share on other sites
My application does need the D3DX stuff unfortunatley. Looks like I just have to make sure that bit gets installed and not worry about the rest.

[quote name='Dunge' timestamp='1304820188' post='4807908']
DirectX10+11 run-times already comes installed on windows7. DirectX10 comes already installed on Vista. Unfortunately, DirectX9 don't comes already installed on any Windows machine. To make things worse, there's over 40 different version of the dll. Usually a game on DVD comes bundled with "directx redistributables" that install the necessary run-times at the end of the game installation if needed. Note that it's also the case with Microsoft Visual C++ redistributables, XNA and .NET framework.



Thats not true since WinXP SP2 DX9.0c is preinstalled, the different dll versions are actually D3DX and if you don't use any of the D3DX functions the applicationwill work fine without the need to install any DX stuff.
[/quote]

Share this post


Link to post
Share on other sites
Well your version of the DirectX SDK should come with all the necessary setup files for you to include with your game. You can also direct your users to the DirectX End-User Web Installer which installs all the missing D3DX DLLs that the end user is missing.

Share this post


Link to post
Share on other sites

Okay, so I need to put DXSETUP into my install. I'm using inno setup 5 for installing my program so I assume what I've got to do is run DXSETUP.EXE at the end of my main install. How does it know which version of directx to use? Do I just put the .cab files for my version in the same path used by the dxsetup? (I need the November 2008 release).


Yes, just run dxsetup (you can also put /silent on the command line to use silent mode) and it will install all components for which it has the .cab files available. It's pretty easy to do with Inno's scripting. If you need help with the Inno stuff, I have some scripts for doing this on my home computer that I can post for you later.

These two pages should have all of the info you need with regards to which cab files you need to include, and launch dxsetup:

http://msdn.microsof...v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/ee418267%28v=vs.85%29.aspx

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!