准备工作:
1. 拷贝cocos2d-x-3.3rc0\external\lua整个文件夹到项目中(如myProject\cocos2d\external\lua)
2. 拷贝cocos2d-x-3.3rc0\cocos\scripting整个文件夹到项目中(如myProject\cocos2d\cocos\scripting)
VS工程配置:
1. 解决方案中添加刚拷贝过来的libluacocos2d项目(添加现有项目: myProject\cocos2d\cocos\scripting\lua-bindings\proj.win32\libluacocos2d.vcxproj)
3. 附加包含目录添加(参考lua-tests工程):
$(EngineRoot)cocos\scripting\lua-bindings\auto
$(EngineRoot)cocos\scripting\lua-bindings\manual
$(EngineRoot)external\lua\luajit\include
$(EngineRoot)external\lua\tolua
$(EngineRoot)external\lua
4. 连接器->输入添加:
lua51.lib
Android.mk配置:
只需添加:
LOCAL_STATIC_LIBRARIES += cocos2d_lua_static
$(call import-module,scripting/lua-bindings/proj.android)
原文链接:https://www.f2er.com/cocos2dx/341353.html