protobuf version 2.5
lua version 5.1.5
protoc-gen-lua Download: http://protoc-gen-lua.googlecode.com/archive/e32bde08c3e8f7b6eb6e09d0d6b0d8c189302ecd.zip
- Compile protobuf: INSTALL.txt installation according protoc last generated in / usr / local / bin
- Modify protoc-gen-lua / pb.c file in Protobuf (refer to Part protoc-gen-lua compiled dll)
- Compile protoc-gen-lua: Modify the Makefile lua5.1 as lua, and finally make a pb.so file
- The soft links ln -s path / plugin in / usr / local / bin / protoc-gen-lua protoc-gen-lua
- Protoc --lua_out performed in example =. / Person.proto
- Run lua test.lua output
Reproduced in: https: //www.cnblogs.com/moonbear/p/3558154.html