Mac上使用Protobuf

2017-05-13  本文已影响0人  SongLiang

第一部分:Mac上搭建Protobuf编译环境及简单使用

1、下载protobuf

使用git的方式到开源社区下载protobuf,在终端种输入以下命令:

git clone https://github.com/google/protobuf.git

2、安装brew

ruby -e "$(curl -fsSL  https://raw.githubusercontent.com/Homebrew/install/master/install)"

3、使用brew安装protoc

brew install protobuf

4.安装 automake

brew install automake

brew install libtool

5、将ProtoBuf协议文件编译为OC文件

protoc –objc_out=./    test.proto


第二部分:例子-编辑*.proto ->生成*.pb.go->在go文件里使用协议test.go

上一篇 下一篇

猜你喜欢

热点阅读