Original Post
When I build I get this error:
3dx9.lib(d3dxmath.obj) : error LNK2005: _D3DXVec2Normalize@8 already defined in d3dx.lib(d3dumath.obj)
d3dx9.lib(d3dxmath.obj) : error LNK2005: _D3DXVec2Hermite@24 already defined in d3dx.lib(d3dumath.obj)
There are 56 more errors just like these, it lists all the different commands, presumably in d3dmath. The line that seems to be causing the error is:
D3DXMatrixTranslation(&matTranslate, position.x, position.y, position.z);
I'm using it like this:
void CGfxEntityModel::render(const D3DXVECTOR3 &position)
{
D3DXMATRIX matTranslate;
// Translate into position
D3DXMatrixTranslation(&matTranslate, position.x, position.y, position.z);
// Apply our world matrix
gD3dDevice->SetTransform(D3DTS_WORLD, &matTranslate);
for (DWORD i = 0; i < m_NumMaterials; i++)
{
// Set the material and texture for this subset
gD3dDevice->SetMaterial(&m_MeshMaterials[i]);
gD3dDevice->SetTexture(0, m_MeshTextures[i]);
// Draw the mesh subset
m_Mesh->DrawSubset(i);
}
}
d3d9.h and d3d9x.h are included.
I have also checked that the position being passed into the function, it passes the correct position.
Also when I edit out the translation line and the gD3DDevice line, my program exits when it gets to:
m_Mesh->DrawSubset(i);
Any help would be appreciated, and a solution to the problem would be even more appreciated.
--Dannon
[edited by - Dannon on April 16, 2004 5:18:26 AM]