Hi all, I am working on a videogame being developed in C++. We use Ogre as our graphics engine.
I get the following error:
1>HostAPI.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Star::ContainerManager::objectsInZone(int,bool,class Star::Container &,class std::vector<int,class std::allocator<int> > &)
Here is the portion of code in class HostAPI.cpp where the error occurs:
int allSuppliesInShelter(lua_State* pLuaState)
{
int zoneID = static_cast<int>(lua_tonumber(pLuaState,1));
Container& parentNode = *(Star::ContainerManager::getSingleton().getRoot());
std::vector<int> objectTypes;
objectTypes.push_back(71);
bool allSuppliesInShelter = Star::ContainerManager::getSingleton().objectsInZone(zoneID, true, parentNode, objectTypes);
lua_pushboolean(pLuaState, true);
return 1;
} // End allSuppliesInShelter
The function objectsInZone is defined as Public in class ContainerManager as follows:
bool objectsInZone(int zoneID, bool allObjects, Container& parentNode, std::vector<int>& objectTypes)
{
ContainerMap::iterator contentsIterator;
for (contentsIterator = parentNode.getContents()->begin(); contentsIterator != parentNode.getContents()->end(); contentsIterator++)
{
Star::Logger::getSingletonPtr()->logf(Star::Logger::LOG_TRIVIAL, "The objectType of the object is %d", (contentsIterator->second)->getObjectType());
if ((contentsIterator->second)->getObjectType() == 71)
{
//if (allObjects)
//{
// In case all objects of the types specified have to be in the zone.
//} // End if (allObjects)
} // End if ((contentsIterator->second)->getObjectType() == 71)
} // End for
if (allObjects)
{
return true;
} // End if
else
{
return false;
} // End else
} // End objectsInZone
Class ContainerManager is included in HostAPI.cpp:
#include <ContainerManager/ContainerManager.h>
Does anybody know why this error could be occuring?