Jump to content
  • Advertisement
Sign in to follow this  
vimesSam

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

This topic is 4393 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, 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
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!