您的位置:首页 > 编程语言 > Lua

lua调用c++

2014-12-17 13:06 176 查看
1. 写pkg文件(就是.h中的public 部分)

2. tolua++ -o "LocalizationManagerLua.cpp" LocalizationManager.pkg 得到导入cpp文件

3. 在appdelegate.cpp中加入两句话

TOLUA_API int luaopen_BattleLayer (lua_State* tolua_S);

luaopen_BattleLayer(pStatck->getLuaState());

或者在toluaapi.h中这么写

#define LUA_CLASS_TABLE \
{ \
LUA_CLASS(CCHTMLLabel) \
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: