I'm using a 3rd party COM-based library called Engine in a native WinRT component which should later act as a wrapper for the 3rd party lib. An Engine.lib and a Engine.h file for the 3rd party lib is setup in my project.
I'm getting the LNK2019 for my following cpp file:
#include "pch.h"
#include "Engine.h"
void Component::Init()
{
ComPtr<IEngine> spEngine;
Settings settings;
CreateEngine(&settings, &spEngine);
}
The code compiles fine and the Engine.lib is setup in the project settings of VS2012. Also does DUMPBIN /EXPORTS for the Engine.lib show that CreateEngine is exposed. I can also use other types defined in the Engine.h, but as soon as CreateEngine is called, a linker error is raised:
Error 1 error LNK2019: unresolved external symbol CreateEngine@8 referenced in function "public: virtual void __cdecl
Engine.h defines CreateEngine like this:
STDAPI CreateEngine(
_In_ Settings * pSettings,
_Outptr_ IEngine **ppEngine );
Where the STDAPI is the usual macro:
#define STDAPI extern "C" HRESULT __stdcall
Any ideas?