[toLua ++] Binding a class - Generated .h fail to compile

Started by
0 comments, last by stodge 17 years, 10 months ago
Hi, I'm using LUA and to LUA to create the GUI of a project using Ogre and CEGUI. Here is what I want to do : I want a function in a LUA script to call a C++ function in my GameEngine class. I cleaned the Gameengine.h file, renamed it to LUAGameEngine.pkg and generated the LUAGameEngine.cpp and LUAGameEngine.h file thanks to this command
tolua+ -H LUAGameEngine.h -o LUAGameEngine.cpp LUAGameEngine.pkg
here is the generated LUAGameEngine.h
/*
** Lua binding: LUAGameEngine
** Generated automatically by tolua++-1.0.7 on 06/08/06 07:54:45.
*/
/* Exported function */
TOLUA_API int  tolua_LUAGameEngine_open (lua_State* tolua_S);
When I add LUAGameEngine.h and LUAGameEngine.cpp to my project, add
tolua_LUAGameEngine_open(scriptmod->getLuaState());
to bind the class and try to compile I get this error from Visual Studio Express 2005 8
c:\documents and settings\dave\desktop\workingoutput\source\globalmain\code\luagameengine.h(7) : error C2144: syntax error : 'int' should be preceded by ';'
c:\documents and settings\dave\desktop\workingoutput\source\globalmain\code\luagameengine.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
I tried to used the cleaned header instead of the generated one but then I couldn't access the tolua_LUAGameEngine_open function... I really don't know what to do next.
Advertisement
Maybe you need an include in your package for the tolua header file?
---------------------http://www.stodge.net

This topic is closed to new replies.

Advertisement