Sign in to follow this  

DirectX Linking Errors

This topic is 3813 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

Hey guys... I've just installed VS 2005 and am having problems compiling. My first problem was that Visual studio couldn't find the d3d9.h / d3dx9.h etc files. I resolved this by adding the DirectX Directory to the VC++ Directories option in Options. However, how when i build i recieve link errors relating to DirectX: - error LNK2019: unresolved external symbol _D3DXVec4Transform@12 referenced in function "public: bool const __thiscall CBoundingBox::TransformVerticesByMatrix(struct D3DXMATRIX const &)" (?TransformVerticesByMatrix@CBoundingBox@@QAE?B_NABUD3DXMATRIX@@@Z) - error LNK2001: unresolved external symbol _GUID_SysKeyboard - unresolved external symbol _Direct3DCreate9@4 are just a few, basicly everything that has to do with DirectX =S.. Is there anyone who has experienced this problem too and could help me out? Thanks Jono

Share this post


Link to post
Share on other sites
Sounds like you're not linking to the DirectX libraries. Add the lib directory from the SDK (make sure you pick the right platform - x86 or x64) to VC++'s Directories (under Library Files), and then specify the libraries that you need (d3d9.lib, etc.). You can do this by going to Project -> Properties -> Linker -> Command Line and writing them in Additional Options.

Share this post


Link to post
Share on other sites
First make sure you've also added the correct path to DirectX libraries to VC++ Directories. To do so go to Tools->Options->Projects and Solutions->VC++ Directories->Choose "Library files" from the drop down list under "Show directories for:" and make sure to add the correct path for your platform, i.e. x86 or x64.
Afterwards go to the Project Property Page->Linker->Input->Additional Dependencies and add d3d9.lib, d3dx9.lib and dxguid.lib.
That's pretty much all you need to do.

Share this post


Link to post
Share on other sites

This topic is 3813 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.

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