• Advertisement
Sign in to follow this  

Strange linker error

This topic is 3370 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been trying to make adding entities to my engine easier, but I've hit a bit of a snag with my Pre-processors. This is the pre-processor i've made to register new entites
#define REGISTER_ENT(Class,Type)
Class C##Type##Foo	{																				public:
C##Type##Foo( void )
{
CeLL::EntityMap::getSingleton().add(#Type, new CeLL::GenericFactory<Class>(#Type));
}
};
static C##Type##Foo mC##Type##Foo; 
and this is the code for the entity map:
	void EntityMap::add(const char* name, BaseFactory* factory)
	{
		Ogre::LogManager::getSingleton().logMessage("Registering entity type: "+std::string(name));
		mFacts.push_back(factory);
	}
and of course, the error:
Quote:
1>Ent_TestCube.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall CeLL::BaseFactory::type(void)" (?type@BaseFactory@CeLL@@UAEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 1>..\Debug\WildCatSim.exe : fatal error LNK1120: 1 unresolved externals

Share this post


Link to post
Share on other sites
Advertisement
You have a function that doesn't have an implementation. The declaration looks like:
virtual std::string CeLL::BaseFactory::type()
Which seems to be unrelated to the preprocessor stuff?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
You have a function that doesn't have an implementation. The declaration looks like:
virtual std::string CeLL::BaseFactory::type()
Which seems to be unrelated to the preprocessor stuff?


thanks man! It's "Working" now (Got a crash from the singleton, should be an easy fix)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement