Tolua接入lua-protoBuf教程

目录

一、资源下载与安装

二、环境配置

三、编译各个平台的dll

四、C#中导入Lua-ProtoBuf

五、导入完成,测试验证

六、生成main.pb

七、拓展阅读


一、资源下载与安装

  1. tolua_runtime:https://codechina.youkuaiyun.com/mirrors/topameng/tolua_runtime?utm_source=csdn_github_accelerator(优快云上的github镜像仓库,源仓库为:https://github.com/topameng/tolua_runtime
  2. NDK下载(NDK版本为:android-ndk-r10e与android-ndk-r15c):https://dl.google.com/android/repository/android-ndk-r10e-windows-x86_64.zip
  3. Msys2(Windows下运行shell脚本环境):https://www.msys2.org/(不会使用的话,可以自搜教程,例如:https://my.oschina.net/u/4256916/blog/3311793https://github.com/topameng/tolua_runtime/wiki
  4. lua-protobuf:https://codechina.youkuaiyun.com/mirrors/starwing/lua-protobuf?utm_source=csdn_github_accelerator(优快云上的github镜像仓库,源仓库为:https://github.com/starwing/lua-protobuf

二、环境配置

  1. 将 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[] = {
        
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值