Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
I found solution: included Lib folder was a promlem. I switched from x64 to x86 folder and it works ok now. –  Phantom Jul 18 '13 at 12:34
1  
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. –  Dean Knight Jul 18 '13 at 13:55

1 Answer 1

up vote 0 down vote accepted

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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