user2170842
user2170842

Reputation:

D3DCompileFromFile unresolved external when linking

During the linking process, Visual Studio tells me that D3DCompileFromFile is an unresolved external symbol.

error LNK2019: unresolved external symbol _D3DCompileFromFile@36

My program compiles fine, but fails when it's linking. I've currently got my (Project properties->Configuration properties->Linker->General->) additional library directories set to: $(WindowsSDK_LibraryPath_x86)

Please could someone let me know what I'm missing.

Also, do you need the DirectX SDK? I've got it, but I've read things about Windows 8 pretty much coming with it.

Edit: Also just noticed I get it for D3D11CreateDeviceAndSwapChain too.

error LNK2019: unresolved external symbol _D3D11CreateDeviceAndSwapChain@48

Thanks.

Upvotes: 4

Views: 7050

Answers (1)

user3146587
user3146587

Reputation: 4320

You need to link against D3DCompiler.lib (and d3d11.lib). This library is part of what was known as the DirectX SDK, which is now integrated in the Windows SDK.

Upvotes: 9

Related Questions