Sign in to follow this  
HandCraftedRadio

DirectX Looking For Wrong .dll file

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 this post


Link to post
Share on other sites
Sc4Freak    643
Quote:
Original post by HandCraftedRadio
I 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 this post


Link to post
Share on other sites
Darragh    308
Quote:
Original post by Sc4Freak
Quote:
Original post by HandCraftedRadio
I 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 HandCraftedRadio
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.


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 this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by HandCraftedRadio
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.
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 this post


Link to post
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 this post


Link to post
Share on other sites
sirob    1181
Add d3dx9.lib to the Additional Dependencies, under Linker in the project properties.
[EDIT] looks like you also need d3d9.lib

Share this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by HandCraftedRadio
I already had both of those included.
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 this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by HandCraftedRadio
I 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 this post


Link to post
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 this post


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