Unresolved symbols in DirectX12 ToolKit project only for x64

457 views Asked by At

I have a dxtk12 project that I worked on earlier. Currently I am using another Windows architecture - x64 and version of VS - 2019 (earlier - x86 and vs2017).

I tried to compile my project for x64 release but got linker errors:

1>DeviceResources.obj : error LNK2001: unresolved external symbol D3D12CreateDevice
1>DeviceResources.obj : error LNK2001: unresolved external symbol CreateDXGIFactory2
1>DirectXTK12.lib(SpriteBatch.obj) : error LNK2001: unresolved external symbol D3D12SerializeRootSignature
1>DirectXTK12.lib(ResourceUploadBatch.obj) : error LNK2001: unresolved external symbol D3D12SerializeRootSignature
1>DirectXTK12.lib(EffectCommon.obj) : error LNK2001: unresolved external symbol D3D12SerializeRootSignature
1>C:\Users\okuma\Downloads\Telegram Desktop\Visual Studio 2015\Projects\simulation\x64\Release\simulation.exe : fatal error LNK1120: 3 unresolved externals

When I switch build option to x86 release all compiled successfully.

I tried to add #pragma comment(lib, "RuntimeObject.lib"), it didn't help.

What am I doing wrong?

1

There are 1 answers

3
Chuck Walbourn On

Those symbols are in d3d12.lib. Most likely you do not have all the same settings in your x64 configuration that you do in your x86.

In the Project Properties dialog, select the x64 platform in the combolist and then "All configurations" in the Configuration list.

Under the Linker make sure your "Additional Dependencies" include:

d3d12.lib;dxgi.lib;dxguid.lib

See directx-vs-templates.