目录
一、资源下载与安装
- tolua_runtime:https://codechina.youkuaiyun.com/mirrors/topameng/tolua_runtime?utm_source=csdn_github_accelerator(优快云上的github镜像仓库,源仓库为:https://github.com/topameng/tolua_runtime)
- NDK下载(NDK版本为:android-ndk-r10e与android-ndk-r15c):https://dl.google.com/android/repository/android-ndk-r10e-windows-x86_64.zip
- Msys2(Windows下运行shell脚本环境):https://www.msys2.org/(不会使用的话,可以自搜教程,例如:https://my.oschina.net/u/4256916/blog/3311793、https://github.com/topameng/tolua_runtime/wiki)
- lua-protobuf:https://codechina.youkuaiyun.com/mirrors/starwing/lua-protobuf?utm_source=csdn_github_accelerator(优快云上的github镜像仓库,源仓库为:https://github.com/starwing/lua-protobuf)
二、环境配置
- 将 lua-protobuf 工程中的pb.c和pb.h拷贝到 tolua_runtime 根目录,覆盖pb.c
1)lua-protobuf:
2)tolua_runtime:
3)msys64:
2.准备工作
1)将lua-protobuf工程中的pb.c和pb.h拷贝到tolua_runtime根目录,覆盖pb.c
2)将 pb.c 中的 luaopen_pb 函数替换为
LUALIB_API int luaopen_pb(lua_State *L) {
luaL_Reg libs[] = {