Problem using D3DXVec3Normalize etc. in console applications

Started by
2 comments, last by TomKQT 14 years, 1 month ago
I'm pretty new to DX in general, and would like to get familiar with the vector manipulation parts of DX before I start setting up scenes with camera and the whole shabang. So, I've started writing a console app which does some basic calculations using D3DXVECTOR3 and similar structures. Feeling pretty lazy, I'd like to use some of the DX functions acting on such 3-vectors, but then the code won't compile (LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function "some_function_I_wrote_which_is_calling_normalize_but_used_to_work_just_fine") Now, I've checked the lib/inc-folders in VC, and they check out fine. Even more, I'm amble to use D3DXVECTOR3s, so I feel a little lost. Anyone got some clues for me? Thanks! Btw: how do you write plus in this board?
Advertisement
Add d3dx9.lib to your list of included libraries.
Mike Popoloski | Journal | SlimDX
Thanks Mike, it works now. I had already set Project->Properties->Configuration Properties->Linker->General->Addtional Library Directories to "C:\Program Files\Microsoft DirectX SDK (August 2009)\Lib\x86". Didn't realize I had to explicitly add the .lib-file (I added it to Linker->Input->Additional Dependencies). Is there any way to actually make the library directory setting work, i.e. not having to manually add every lib I'm gonna use?
I don't think you can just set a directory and let the compiler automatically use all the libs there. It would not know which of them you really want and need.

Btw, you can also link the lib files using this code, you don't have to do it in the project properties:

#pragma comment(lib, "d3dx9.lib")

This topic is closed to new replies.

Advertisement