我为一些虚拟功能得到了一个未解决的链接错误。
我有一个接口IFieldManager
,我使用ImplFieldManager
实现它。
所以我有两个需要实现的功能FieldToArea()
和FieldToPoi()
。已经实施。
完整的错误消息:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: virtual bool __thiscall ImplFieldManager::FieldToArea(struct S3W::IField const &,struct S3W::IArea &)" (?FieldToArea@ImplFieldManager@@UAE_NABUIField@S3W@@AAUIArea@3@@Z) Schiebel3DWorld (Libraries\Schiebel3DWorld\Schiebel3DWorld) D:\andre\OSGEarthLib_VS2015-build\Schiebel3DWorld\src\ImplIConnection.obj 1
我的代码:
#include "Schiebel3DWorld/include/IArea.h"
#include "Schiebel3DWorld/include/IField.h"
#include "Schiebel3DWorld/include/IPoi.h"
namespace S3W
{
struct IFieldManager
{
IFieldManager() {}
virtual ~IFieldManager() {}
virtual bool FieldToArea(const IField& areas, IArea& manager) = 0;
virtual bool FieldToPoi(const IField& areas, IPoi& manager) = 0;
};
}
namespace S3W
{
struct IFieldManager;
struct IServerConnection : public CImplRefPtr, virtual public IRefPtr
{
virtual IFieldManager* GetFieldManager() = 0;
};
}
namespace S3W
{
struct ImplConnection : public S3W::IServerConnection, public SNet::SThread
{
// Inherited via IServerConnection
virtual S3W::IFieldManager * GetFieldManager() override;
};
}
#include "Schiebel3DWorld/include/IFieldManager.h"
struct ImplFieldManager : public S3W::IFieldManager
{
ImplFieldManager(){}
~ImplFieldManager() {}
// Inherited via IFieldManager
virtual bool FieldToArea(const S3W::IField & areas, S3W::IArea & manager) override;
virtual bool FieldToPoi(const S3W::IField & areas, S3W::IPoi & manager) override;
};
S3W::IFieldManager * S3W::ImplConnection::GetFieldManager()
{
return new ImplFieldManager();
}
#include "ImplFieldManager.h"
bool ImplFieldManager::FieldToArea(const S3W::IField & areas, S3W::IArea & manager)
{
return false;
}
bool ImplFieldManager::FieldToPoi(const S3W::IField & areas, S3W::IPoi & manager)
{
return false;
}