When using COM objects, occasionally, you may run into “LNK2001 unresolved external” errors. This is often because the header file that declares the GUID for the COM object or interface is using DEFINE_GUID. This macro is setup to declare the GUID as extern, meaning it needs to finally reside somewhere. The error you are getting means that it has no home.
So solve this issue, include “InitGuid.h” before your header file that is declaring the GUID. Ultimately, it actually needs to be before guiddef.h so you may need to include it in your precompiled headers if guiddef.h is being included somewhere in there.
In my case, I was including “Evalcom2.h” and CLSID_EvalCom2 and IID_IValidate were unresolved. To solve it, I did this:
// So the GUIDs get defined (and not just declared)
#include <InitGuid.h>
#include <Evalcom2.h>
More information can be found on Microsoft’s page, here.