microsoft/DirectXTex

error LNK2019: unresolved external symbol IID_ID3D11Texture2D

cold-blue opened this issue · 1 comments

I tried to use SaveWICTextureToFile in ScreenGrab11 but encountered a problem as below:

bindings.lib(ScreenGrab11.o) : error LNK2019: unresolved external symbol IID_ID3D11Texture2D referenced in function "long __cdecl `anonymous namespace'::CaptureTexture(struct ID3D11DeviceContext *,struct ID3D11Resource *,struct D3D11_TEXTURE2D_DESC &,class Microsoft::WRL::ComPtr &)" (?CaptureTexture@?A0xe9781e44@@YAJPEAUID3D11DeviceContext@@PEAUID3D11Resource@@AEAUD3D11_TEXTURE2D_DESC@@aeav?$ComPtr@UID3D11Texture2D@@@wrl@Microsoft@@@z)
C:\Users\yuhanliu\OneDrive - Intel Corporation\Desktop\Codes\ALVR-master\target\release\deps\alvr_server.dll : fatal error LNK1120: 1 unresolved externals

Here is my code:
`

 m_pD3DRender->GetContext()->CopyResource(pInputTexture, pTexture);
if (m_nFrame == 5) {
    DirectX::SaveWICTextureToFile(m_pD3DRender->GetContext(), pInputTexture, GUID_ContainerFormatPng, 
	L"input_buffer_data.png");
	}

`

You need to link with dxguid.lib which is generally assumed for all DirectX applications.