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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top