I have simple DirectX project:

#include <d3dx10.h>
#include <d3dx10math.h>

#pragma comment(lib, "d3d10.lib")
#pragma comment(lib, "d3dx10.lib")

int main()
    D3DXVECTOR3 u(1.0f, 2.0f, 3.0f);
    D3DXVECTOR3 v(2.0f, 1.0f, 3.0f);
    D3DXVECTOR3 a, b, c, d, e;

    float l = D3DXVec3Length(&u);
    float s = D3DXVec3Dot(&u, &v);

    D3DXVec3Normalize(&d, &u); // <- problem is here

    return 0;

I added "include" and "lib" directories in my project properties and everything works fine, except D3DXVec3Normalize line. When I run the program it says: "error LNK2019: unresolved external symbol _D3DXVec3Normalize@8 referenced in function _main".

Can anyone explain why D3DXVec3Length and D3DXVec3Dot functions work OK (without Normalize line) and D3DXVec3Normalize produces error?

P.S. I use DirectX SDK June 2010 and Visual Studio 2012.

  • \$\begingroup\$ I found solution: included Lib folder was a promlem. I switched from x64 to x86 folder and it works ok now. \$\endgroup\$ – Phantom Jul 18 '13 at 12:34
  • 1
    \$\begingroup\$ Add an answer to your own question and document the exact steps you went through to fix the issue. You can then accept the answer. This is great for people down the line who run into the same issue. \$\endgroup\$ – Dean Knight Jul 18 '13 at 13:55

So, at first I included following directories into my project: ...\DirectXSDK\Include and ...\DirectXSDK\Lib\x64 (I thought it is OK because I use Windows 7 64 and Visual Studio 2012 64). Everything worked fine except D3DXVec3Normalize function. Then I started to experiment and found the following solution: I switched from x64 to x86 directory in the project properties and error has gone. Looks like my project is x86 application, so I should use x86 libs in that case (I am beginner in c++ and DirectX).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.