D3dcompile unresolved external symbol


#1

im getting this error trying to compile my program:

Severity	Code	Description	Project	File	Line	Suppression State

Error LNK2019 unresolved external symbol D3DCompile referenced in function “bool __cdecl ImGui_ImplDX10_CreateDeviceObjects(void)” (?ImGui_ImplDX10_CreateDeviceObjects@@YA_NXZ) Alpha C:\Users\admin\Desktop\d3d10 test\Source\imgui_impl_dx10.obj 1

I have both cpp and header included in it (imgui_impl_dx10.cpp and imgui_impl_dx10.h)
what is the problem ? :expressionless:


#2

You need to link with d3dcompiler.lib to use the D3DCompile().
The latest code on master in imgui_impl_dx10.cpp automatically pulls this library in if you use Visual Studio

#ifdef _MSC_VER
#pragma comment(lib, "d3dcompiler") // Automatically link with d3dcompiler.lib as we are using D3DCompile() below.
#endif

Else add d3dcompiler.lib to your linker.

Note that you would find this answer if you googled “Error LNK2019 unresolved external symbol D3DCompile referenced”.