Jump to content
  • Advertisement
Sign in to follow this  
CAPE

Luabind problem in release!

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

Hi all. I have a little problem with luabind. When i compile and ru my program in debug, it works fine, no problem there. But when I try to do the same thing in release, it compiles but crashes when I try to bind my first class with luabind. Here is the initalize:
	_lState = lua_open();

	luaL_openlibs( _lState );

	luabind::open( _lState );

	Ogre::String folder = cf.getSetting("LUADir");
	int size = Ogre::StringConverter::parseInt(cf.getSetting("NumberOfScripts"));

	int error;
	for(int i = 0; i < size; i++)
	{
		error = luaL_dofile(_lState, (folder+cf.getSetting("ScriptFile", Ogre::StringConverter::toString(i))).c_str());
		if( error != 0 )
		{
			std::cout << "Cant read the file at: " <<  folder << cf.getSetting("ScriptFile", Ogre::StringConverter::toString(i)).c_str() << std::endl;
			return false;
		}
		
		_loopSpawn.push_back(cf.getSetting("LoopStart", Ogre::StringConverter::toString(i)).c_str());
	}


And here is the class binding where my program crashes:
	luabind::module(LUAManager::GetInstance()->GetState())
		[
			luabind::class_<StateMachine<Robot>>("StateMachine")
			.def("ChangeState", &StateMachine<Robot>::ChangeState)
			.def("CurrentState", &StateMachine<Robot>::CurrentState)
			.def("SetCurrentState", &StateMachine<Robot>::SetCurrentState)
		];

I do nothing lua related between these chunks of code, so I dont think you need any more code than that. And when it crashes, it says: "Expresion: vector iterator not dereferecable". I know what it means, but I do not know the cause. As you can see, the class I try to bind is a template, if that could be the problem, but as it works with the debug, I think it would be strange. Any help would be appreciated.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!