# DirectX Looking For Wrong .dll file

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

## Recommended Posts

When I try to run a compiled direct x app, it says that D3DX9.dll was not found. That file does not come with the redistributable package, the dll is in the form of D3DX9_xx.dll. When I change the D3DX9_xx.dll file names to just D3DX9.dll, it runs fine. Does anyone know how to make it use the D3DX9_xx.dll file? I am using Dev-Cpp. Thanks.

##### Share on other sites
Quote:
 Original post by HandCraftedRadioI am using Dev-Cpp. Thanks.

Don't. Use Visual Studio 2008 Express Edition. It's free, and a far better IDE than DevC++. Visual Studio is the only officially supported compiler for the DirectX SDK, too.

##### Share on other sites
I tried to use vc 2005 but I kept getting errors when trying to set it up. But if its the only way then I guess I'll have to figure it out.

##### Share on other sites
Quote:
Original post by Sc4Freak
Quote:
 Original post by HandCraftedRadioI am using Dev-Cpp. Thanks.

Don't. Use Visual Studio 2008 Express Edition. It's free, and a far better IDE than DevC++. Visual Studio is the only officially supported compiler for the DirectX SDK, too.

Indeed, DevC++ is just horrible. Debugging just doesn't work in it, code completion is a joke and it crawls to standstill on any moderately sized project. If you are looking for a DevC++ alternative but don't want to use Visual Studio try Codeblocks. I used to be a big advocate of this IDE myself for a long time- until I tried the VS 2005 that is! [wink]

Quote:
 Original post by HandCraftedRadioI tried to use vc 2005 but I kept getting errors when trying to set it up. But if its the only way then I guess I'll have to figure it out.

What errors are you getting ? Have you downloaded and installed the Microsoft Platform SDK beforehand ? Visual Studio 2005/2008 unfortunately does not come with any of the libraries needed for regular C++ Windows development; you'll need it for doing anything with OpenGL or DirectX. You'll also need to download the DirectX SDK too since you are developing for DirectX.

##### Share on other sites
Quote:
 Original post by HandCraftedRadioWhen I try to run a compiled direct x app, it says that D3DX9.dll was not found. That file does not come with the redistributable package, the dll is in the form of D3DX9_xx.dll. When I change the D3DX9_xx.dll file names to just D3DX9.dll, it runs fine. Does anyone know how to make it use the D3DX9_xx.dll file? I am using Dev-Cpp. Thanks.
d3dx9.dll is the name of a pretty old version of the D3DX DLL. You should be downloading the DirectX redistributable package to correctly set up the D3D DLLs.

##### Share on other sites
The Forum FAQ covers the D3DX redistributables. Create yourself an installer for the optional dependencies you've taken out and you're ready to roll [smile]

hth
Jack

##### Share on other sites
I have been trying to compile with VC2008 but it is not working right. There are many linker errors related to directx but I can't get it to link correctly. I am including all the same libraries that I used before. Here are the errors:

1>Camera.obj : error LNK2019: unresolved external symbol _D3DXVec3TransformCoord@12 referenced in function "public: void __thiscall Camera::Pitch(float)" (?Pitch@Camera@@QAEXM@Z)
1>Camera.obj : error LNK2019: unresolved external symbol _D3DXMatrixRotationAxis@12 referenced in function "public: void __thiscall Camera::Pitch(float)" (?Pitch@Camera@@QAEXM@Z)
1>Camera.obj : error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "public: void __thiscall Camera::Update(void)" (?Update@Camera@@QAEXXZ)
1>dsutil.obj : error LNK2019: unresolved external symbol _DXTraceA@20 referenced in function "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z)
1>dsutil.obj : error LNK2019: unresolved external symbol _DirectSoundCreate8@12 referenced in function "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z)
1>GameEngine.obj : error LNK2019: unresolved external symbol _D3DXCreateFontIndirectA@12 referenced in function "public: void __thiscall GameEngine::Init(struct HINSTANCE__ *,int,int,bool,struct IDirect3DDevice9 * *)" (?Init@GameEngine@@QAEXPAUHINSTANCE__@@HH_NPAPAUIDirect3DDevice9@@@Z)
1>MainFile.obj : error LNK2001: unresolved external symbol _D3DXCreateFontIndirectA@12
1>GameEngine.obj : error LNK2019: unresolved external symbol _D3DXMatrixPerspectiveOffCenterLH@28 referenced in function "public: void __thiscall GameEngine::Init(struct HINSTANCE__ *,int,int,bool,struct IDirect3DDevice9 * *)" (?Init@GameEngine@@QAEXPAUHINSTANCE__@@HH_NPAPAUIDirect3DDevice9@@@Z)
1>GameEngine.obj : error LNK2001: unresolved external symbol _c_dfDIJoystick2
1>GameEngine.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
1>GameEngine.obj : error LNK2001: unresolved external symbol _c_dfDIMouse
1>GameEngine.obj : error LNK2019: unresolved external symbol _DirectInput8Create@20 referenced in function "public: void __thiscall GameEngine::Init(struct HINSTANCE__ *,int,int,bool,struct IDirect3DDevice9 * *)" (?Init@GameEngine@@QAEXPAUHINSTANCE__@@HH_NPAPAUIDirect3DDevice9@@@Z)
1>GameEngine.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4 referenced in function "public: void __thiscall GameEngine::Init(struct HINSTANCE__ *,int,int,bool,struct IDirect3DDevice9 * *)" (?Init@GameEngine@@QAEXPAUHINSTANCE__@@HH_NPAPAUIDirect3DDevice9@@@Z)
1>Sprite.obj : error LNK2019: unresolved external symbol _D3DXCreateTextureFromFileExA@56 referenced in function "void __cdecl CreateTexture(class GameEngine *,char const *,struct IDirect3DTexture9 * *)" (?CreateTexture@@YAXPAVGameEngine@@PBDPAPAUIDirect3DTexture9@@@Z)

##### Share on other sites
[EDIT] looks like you also need d3d9.lib

##### Share on other sites
Try to insert dependencies in the code

#include <d3d9.h>#include <d3dx9.h>#pragma comment(lib,"d3d9.lib")#pragma comment(lib,"d3dx9.lib")

##### Share on other sites
Quote:
Then the compiler can't find the files. Have you got your paths set up correctly?

In VC2005, you go to Tools -> Options -> Projects and Solutions -> VC++ Directories, and make sure that the DirectX SDK paths are all added in each of the "Show directories for:" entries. Also note that the .lib file aren't in the "lib" directory, but in "lib/x86" or "lib/x64" for 64-bit builds.
In VC2008, the settings will be almost identical.

##### Share on other sites
I had the directx lib and include paths set up. Are there any other paths i need to set for the other catagories?

##### Share on other sites
Quote:
 Original post by HandCraftedRadioI had the directx lib and include paths set up. Are there any other paths i need to set for the other catagories?
Nope. What about if you put the .h and .lib files in the same directory as your project (Just for testing)? That should tell you if it's a directory problem or something else.

##### Share on other sites
Fixed. I had both the x64 and x86 paths set for the libraries. I removed the x64 path and it worked. I don't quite understand it but it works so I'm just going to leave it. Thanks, everyone, for your time and help.

##### Share on other sites
The linker will usually search through paths until it finds a file with the same name as the one you want to link. If it stumbles across the x64 first and you want the x86, it won't even try the x86 one (vice versa, and same goes for include paths).

##### Share on other sites

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

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628681
• Total Posts
2984188

• 13
• 12
• 9
• 10
• 10