So I'm playing with binding Lua to C++ for class. I have an example which does the binding correctly. What I am trying to toy with now is sharing objects between Lua scripts which will be referenced by a name.

So I have a Badger class which is binded to Lua via LuaBadger. Now what I have attempted to do is make a BadgerManager class which gets called when the Lua script attempts to create a new Badger. It checks to see if the Badger is already created then returns that Badger. Probably pointless and going about it the wrong way but I'm just kind of playing around at this point.

Issue is that when I attempt to store and use a BadgerManager pointer in my LuaBadger class it is telling me unresolved external symbol. It has to be something with my use of static in the class. Although I'm apparently misunderstanding what I am doing. Any help on resolving the unresolved would be great. Thank!

BadgerManager (part of SimpleLua.h)
Code:
class BadgerManager
{
public: 
	BadgerManager(){ };
	~BadgerManager(){ };

	Badger* GetBadger(const char* name) 
	{
		Badger* b = 0;
		list<Badger*>::iterator itr = badgerList.begin();
		while(itr != badgerList.end())
		{
			if(strcmp(name, (*itr)->GetName()))
			{
				b = (*itr);
				break;
			}
		}

		if(!b)
		{
			(*b) = Badger(name);
		}

		return b;
	};
private:
	list<Badger*> badgerList;
};
Excerpt from LuaBadger (below BadgerManager in SimpleLua.h)
Code:
static BadgerManager* bm;

static int create_badger(lua_State* L)
{
	Badger* b;
	const char* name = luaL_checkstring(L, 1);

	b = (Badger*)lua_newuserdata(L, sizeof(Badger));
	luaL_getmetatable(L, className);
	lua_setmetatable(L, -2);

	//(*b) = Badger(name);
	b = bm->GetBadger(name);

	return 1;
}
If I comment out bm->GetBadger(name) everything compiles fine.