我在阅读 c++ 错误方面很糟糕,但显然未解析的外部符号意味着我正在使用的函数没有定义。我得到的错误是......
1>WorldState.obj : error LNK2001: unresolved external symbol "public: class Brutal::GameObject * __thiscall Brutal::GameObjectManager::createObject<class Player>(class Ogre::Vector3,class Ogre::Quaternion,class Brutal::PropertyList,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??$createObject@VPlayer@@@GameObjectManager@Brutal@@QAEPAVGameObject@1@VVector3@Ogre@@VQuaternion@4@VPropertyList@1@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>C:\Users\Brett\Desktop\Factions Online\build\release\client\client.exe : fatal error LNK1120: 1 unresolved externals
这没有任何意义,因为 createObject 已定义,甚至在我右键单击它并单击“转到定义”时在 MSVC 中适当出现
我的代码调用它是......
Brutal::GameObjectManager::getSingletonPtr()->createObject<Player>(Ogre::Vector3::ZERO, Ogre::Quaternion::IDENTITY);
所以我错过了什么愚蠢的东西吗?