Advertisement

help with luabind..

Started by February 10, 2004 10:13 PM
1 comment, last by nekoflux 20 years, 7 months ago
hey: ok, so I got lua and luabind working with my codebase. Im trying to expose certain class functions to lua. Heres the modue definition: module(luaVM) [ class_("CSimulation") .def(constructor<>()) .def("loadscene", &CSimulation::loadscene) .def("loadmodel", &CSimulation::loadmodel) ]; now, when I comment out the load model function it works fine (I am able to use loadscene() in lua). Here is a simplified version of CSimulation:

class CSimulation {
public:
	CSimulation();	//Constructor

	~CSimulation();	//Destructor

   
private: 
   int loadmodel(char*);		
   int loadscene();			

};
I noticed that if I change loadmodel''s function definition to int loadmodel(); it compiles fine. So It is complaining about the char* parameter Im pretty sure...any clues guys? thank you!! neko
nekoflux
Change the char* to be a:

const std::string&

or a

const char*.

I''m assuming that because of memory management issues you need to use relatively ''safe'' types.
Advertisement
awesome, it works.

Andrew, you are like a machine dude...



neko
nekoflux

This topic is closed to new replies.

Advertisement