Search code examples
c#c++windows-store-appsdirect2d

How to solve "error LNK2001: unresolved external symbol _CLSID_D2D1Blend" when using Direct2d Effects?


I'm developing a Windows Runtime Component (Visual C++) drawing lib to be used on a Windows Store App C# Project.

Everything was running as expected until I started to add some Effects capabilities to the lib.

When trying to create an effect like bellow:

    m_d2dContext->CreateEffect(CLSID_D2D1Blend, &m_blendEffect)

The following error is shown:

    1>MyLibFile.obj : error LNK2001: unresolved external symbol _CLSID_D2D1Blend

I already have these pragma comments on my pch.h:

    #pragma comment(lib, "d3d11")
    #pragma comment(lib, "d2d1")

I suspect that some definition is missing but I do not know what as the #pragma comment(lib, "d2d1") was already added to the pch.h.

I'm running Windows 10 Technical Preview build 9860 and VS Express 2013 update 3 on a virtual machine - VM-Ware.

This is a sample project using effects and direct 2d: Direct2D-Image-Effects


Solution

  • As it stands in the MSDN - Blend Effect: Library - d2d1.lib, dxguid.lib

    You are missing the dxguid.lib

    Also, you can use the raw GUID: {81C5B77B-13F8-4CDD-AD20-C890547AC65D}