I just changed all my headers from the DirectX SDK to the Windows SDK and replaced xnamath.h
for DirectXMath.h
. But everytime i call the functions DirectX::XMVectorSet()
, DirectX::XMMatrixLookAtLH()
, DirectX::XMVectorGetX()
, XMMatrixRotationRollPitchYaw()
and XMVector3TransformCoord()
, the linker gives the "Unresolved external symbol" error. I already tried linking the appropriate libraries and headers in Visual Studio 2015, but this didn't change anything.
Down below is my usage of the functions
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")
#pragma comment (lib, "D3D11.lib")
#pragma comment (lib, "d3dcompiler.lib")
#include <windows.h>
#include <D3D11.h>
#include <dinput.h>
#include <D3Dcompiler.h>
#include <sstream>
#include <SimpleMath.h>
#include <DDSTextureLoader.h>
#include <WICTextureLoader.h>
#include <SpriteBatch.h>
#include <SpriteFont.h>
void Create_Camera_View_Space()
{
camPosition = DirectX::XMVectorSet(0.0f, 2.0f, -12.5f, 0.0f); //Unresolved External Symbol
camDirection = DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f); //Unresolved External Symbol
camUp = DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f); //Unresolved External Symbol
CameraView = DirectX::XMMatrixLookAtLH( // Unresolved external symbol"
camPosition,
camDirection,
camUp
);
}
void Create_Camera_Projection_Space()
{
CameraProjection = DirectX::XMMatrixPerspectiveFovLH(
0.4f * 3.14f,
(float)400 / 400,
1.0f,
10000.0f
);
}
void Create_World_Space_for_Ground()
{
DirectX::XMMATRIX Translation;
DirectX::XMMATRIX Rotation;
DirectX::XMMATRIX Scale;
DirectX::XMMATRIX Input_Rotation_X;
DirectX::XMMATRIX Input_Rotation_Z;
GroundWorld = DirectX::XMMatrixIdentity();
Scale = DirectX::XMMatrixScaling(500.0f, 10.0f, 500.0f);
Translation = DirectX::XMMatrixTranslation(0.0f, 10.0f, 0.0f);
GroundWorld = Scale * Translation;
}
void Create_World_Space_for_SkyBox()
{
DirectX::XMMATRIX Scale;
DirectX::XMMATRIX Translation;
SkyWorld = DirectX::XMMatrixIdentity();
Scale = DirectX::XMMatrixScaling(0.5f, 0.5f, 0.5f);
Translation = DirectX::XMMatrixTranslation(
DirectX::XMVectorGetX(camPosition), //Unresolved External Symbol
DirectX::XMVectorGetY(camPosition), //Unresolved External Symbol
DirectX::XMVectorGetZ(camPosition) //Unresolved External Symbol
);
SkyWorld = Scale * Translation;
}
Im not sure if this will really help, but down below are the linker errors
error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVectorSet(float,float,float,float)
error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVector3Dot(union __m128,union __m128)
error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVectorSubtract(union __m128,union __m128)
error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVectorSubtract(union __m128,union __m128)
What can I do to fix these errors??
EDIT: I already went to the link What is an undefined reference/unresolved external symbol error and how do I fix it?, but this did not solve my problem.