Chris
Chris

Reputation: 191

How to package d3dx9_43.dll in to my application?

I have made a small game which I need to take in to a school to carry out some testing.

Unfortunately, being a school system, I will need to package all DLLs not already installed so that it will run. Installing anything on the computers is out of the question. When I went down a few days ago I noticed that the application would not start up due to a missing d3dx9_43.dll file.

I have statically linked the libraries I have used and am confused as to why this wasn't included. I referenced all the Direct3D 9 libraries I used (or so I thought).

Can anyone help me out?

I am using Visual Studio C++ 2010 and used Direct3D 9.

Upvotes: 2

Views: 2052

Answers (2)

zakinster
zakinster

Reputation: 10688

It's supposed to be done by including the DirectX 9.0 Redistributable package inside the application installer, but since you can't install anything you either have to ship all the dll with your executable (which is against the SDK license) or statically link against the DirectX runtime (which is also probably not allowed).

Statically link against the DirectX runtime is not a good idea and is not as trivial as it seems, I'm not even sure it's possibe but you must have to have the actual static libraries (not the one that are actually linked by themselves against the dll).

So the easiest solution would be to keep all the needed DLL with the exe, if you're worried about missing one dependency you can use the Dependency Walker. Note that this solution is not allowed by the SDK license and cannot be used to actually distribute an application to the final users.

Upvotes: 1

David Heffernan
David Heffernan

Reputation: 612993

The only option that abides by the license is to install the redistributable package.

Earlier versions of D3DX did support static linking, but for reasons of security MS changed the rules to ban static linking. They wanted to be able to service these DLLs through WIndows Update and that's only possible if they are installed using the official redistributable package.

One possible option for you is to see if you can avoid linking to D3DX. It may be that you use a small enough footprint of that library that you can bypass it.

Upvotes: 2

Related Questions