0

Upon compilation of my program I am getting the following errors:

Error   59  error LNK2019: unresolved external symbol _D3DXMatrixTranspose@8 referenced in function "private: bool __thiscall ColorShaderClass::SetShaderParameters(struct ID3D11DeviceContext *,struct D3DXMATRIX,struct D3DXMATRIX,struct D3DXMATRIX)" (?SetShaderParameters@ColorShaderClass@@AAE_NPAUID3D11DeviceContext@@UD3DXMATRIX@@11@Z)    D:\Programs\C++\DirectX 11\Tutorial 2\Tutorial 1\colorshaderclass.obj   Tutorial 1

Error   60  error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "private: bool __thiscall ColorShaderClass::InitializeShader(struct ID3D11Device *,struct HWND__ *,wchar_t *,wchar_t *)" (?InitializeShader@ColorShaderClass@@AAE_NPAUID3D11Device@@PAUHWND__@@PA_W2@Z) D:\Programs\C++\DirectX 11\Tutorial 2\Tutorial 1\colorshaderclass.obj   Tutorial 1

Error   61  error LNK1120: 2 unresolved externals   D:\Programs\C++\DirectX 11\Tutorial 2\Debug\Tutorial 1.exe  Tutorial 1

I have looked everywhere on the internet for an answer and have tried everything I found, does anyone know why I am getting these errors or how I can fix them?

valiano
  • 16,433
  • 7
  • 64
  • 79
JustinWeq
  • 158
  • 11
  • 1
    You don't include enough information in your question for me to answer that, but take a look at [What is an undefined reference/unresolved external symbol error and how do I fix it?](http://stackoverflow.com/q/12573816/33499) first. – wimh Jan 14 '15 at 19:57

1 Answers1

1

You forgot to link some libraries for the functions you use: D3DXMatrixTranspose and D3DX11CompileFromFile

You can do this by adding the corresponding libraries to the Linker:

Project -> [ProjectName] Properties... -> Configuration Properties -> Linker -> Input -> Additional Dependencies - then add these libraries:

  • D3DX10.lib
  • D3DX11.lib
Rakete1111
  • 47,013
  • 16
  • 123
  • 162