问题
I just removed all of the headers that were included in the DirectX SDK and i moved towards the Windows SDK, but once I did, the linker constantly complains about an "unresolved external symbol". The linker shows about 24 errors and most of these errors are about functions that I'm not even using in my game.
Linker errors: error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVectorMultiply(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::XMVector3Normalize(union __m128)
error LNK2001: unresolved external symbol "union __m128 __vectorcall DirectX::XMVectorSet(float,float,float,float)
I have not used XMVector3Normalize(), XMVectorSubtract() and XMVectorMultiply() in my application, but I did use the XMVectorSet().
Most of these functions are part of the DirectXMath.h, so what could be wrong here.
Anyway, I don't know if this will help, but down below are all the headers that i used in my application.
#include <windows.h>
#include <D3D11.h>
#include <dinput.h>
#include <SimpleMath.h>
#include <D3Dcompiler.h>
#include <sstream>
#include <SpriteFont.h> //This file also includes DirectXMath.h
#include <DDSTextureLoader.h>
#include <WICTextureLoader.h>
#pragma comment (lib, "D3D11.lib")
#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")
#pragma comment (lib, "d3dcompiler.lib")
What can i do to fix these linker problems? I already linked the apropriate libraries and headers using Project->Properties-> VC++ Directories ->Include Directories and Library Directories in Visual Studio 2015.
I've been trying to solve this problem for the past hour or so. Can anyone help me?
来源:https://stackoverflow.com/questions/33714883/linker-keeps-showing-errors-after-i-changed-from-directx-sdk-to-windows-sdk