Sign in to follow this  
vimesSam

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this