Sign in to follow this  

Strange linker error

This topic is 3297 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
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

This topic is 3297 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this