🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

help with luabind..

Started by
1 comment, last by nekoflux 20 years, 4 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
Advertisement
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.
awesome, it works.

Andrew, you are like a machine dude...



neko
nekoflux

This topic is closed to new replies.

Advertisement