We help IT Professionals succeed at work.
Get Started

error LNK2019: unresolved external symbol "public: bool __thiscall

Lou1
Lou1 asked
on
1,161 Views
Last Modified: 2013-12-14
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?
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2012
Commented:
This problem has been solved!
Unlock 2 Answers and 3 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE