我正在尝试创建一个实现IUnknown
接口的类。我在头文件中有以下代码:
#pragma once
#include "stdafx.h"
#include "Unknwn.h"
class Vmr9Presenter : IVMRImagePresenter9, IVMRSurfaceAllocator9
{
public:
Vmr9Presenter(void);
HRESULT Initialize(void);
~Vmr9Presenter(void);
STDMETHODIMP QueryInterface(const IID &riid, void **ppvObject);
};
我已经包括了相关的uuid.lib
和其他几个。但是,当我尝试编译时,出现错误:
错误 2 错误 LNK2001: 无法解析的外部符号 "public: virtual long __stdcall Vmr9Presenter::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@Vmr9Presenter@@UAGJABU_GUID@@PAPAX@Z) Vmr9Presenter.obj VmrPresenter
这让我相信有些东西没有被拉进来。关于如何摆脱这个错误的任何建议?