1.lua开发需要用到一些额外的库例如 pb,cjson ,crypto filesystem ,lpack ,sqlite3,zlib等等。
2.新建一个文件夹放入依赖的库。
3. 下载protobuf:2.5.0 地址 https://github.com/protocolbuffers/protobuf/releases?after=v3.0.0-alpha-1 里面可以下载Version 2.5.0
protoc-gen-lua下载地址 https://github.com/sean-lin/protoc-gen-lua
可参考http://www.cppblog.com/colorful/archive/2015/02/12/209802.aspx
https://www.cnblogs.com/wkccs/p/4131033.html
下载完 protobuf-2.5.0.tar 和 protoc-2.5.0-win32 , 并把 protoc-2.5.0-win32 下的 protoc.exe 拷贝到 protobuf-2.5.0\src 下,这样可以执行python
在 protobuf-2.5.0\python 下运行 python setup.py build 和 python setup.py install (注意下载python 配置环境)
在protoc-gen-lua里面有pb.c 放入c++工程中编译 修改两处位置
将#include <endian.h>修改为 #ifndef _WIN32 #include <endian.h> #endif
调整struct_unpack函数前几行为 uint8_t out[8]; buffer += pos; 两句位置调换
https://www.cnblogs.com/wkccs/p/4131033.html
https://blog.csdn.net/sunqiqi2121/article/details/50786011