c++ - DirectX D3DXVec3Normalize unresolved external symbol -
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 here return 0; }
i added include , lib directories in project properties , works fine, except d3dxvec3normalize line. when run program says: "error lnk2019: unresolved external symbol _d3dxvec3normalize@8 referenced in function _main".
can explain why d3dxvec3length , d3dxvec3dot functions work ok (without normalize line) , d3dxvec3normalize produces error?
p.s. use directx sdk june 2010 , visual studio 2012.
the linker error means code fine, did not provide location of d3dxvec3normalize
function, library actual function resides.
msdn suggests it's d3dx9.lib, add code:
#pragma comment(lib, "d3dx9.lib") // can supposedly d3dx10.lib
Comments
Post a Comment