首先是一小段代码:
class CDb
{
public:
void CreateLeague(const League &data);
protected:
int InsertOwners(const std::vector<std::string> &owners, int leagueId);
};
void CDb::CreateLeague(const League &data)
{
// some code
if( InsertOwners( data.GetOwners(), leagueId ) != SQLITE_OK )
{
// ROLLBACK transaction
}
}
int CDb::InsertOwners(const std::vector<std::string> &owners, int leagueId)
{
}
函数GetOwners()
声明为:
std::vector<std::string> &GetOwners() const;
在链接期间,我得到以下信息:
未解析的外部符号“受保护:int __thiscall CDb::InsertOwners(class std::vector,class std::allocator >,class std::allocator,class std::allocator > > > const &,int)”(?InsertOwners@ CDb@@IAEHABV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits @D@std@@V?$allocator@D@2@@std@@@2@@std@@H@Z) 在函数“public: void __thiscall CDb::CreateLeague(class CLeagueSettings const &)”中引用( ?CreateLeague@CDb@@QAEXABVCLeagueSettings@@@Z) 1>vc_mswud\baseballdraft.exe : 致命错误 LNK1120: 1 unresolved externals
在 Windows 7 上使用 MSVC 2010。
请帮忙。