TCP/Protobuf之Protocol Buffers配置指南

使用Protobuf,先配置环境,以下是配置Protobuf的步骤和编译Protobuf原文件的步骤

Java:

Compiled Environment Download:

https://github.com/google/protobuf/releases/download/v3.0.0-beta-3/protobuf-java-3.0.0-beta-3.zip

Install:
$ ./configure
$ make
$ make check
$ make install
Check version:
$ protoc --version    

Protocol Buffers Output

https://developers.google.com/protocol-buffers/

To Objective-C(.h .m)
$ protoc --proto_path=src --objc_out=build/gen src/foo.proto src/bar/baz.proto
To Java(.java)
$ protoc --proto_path=src --java_out=build/gen src/foo.proto

–proto_path可以缩写为: -I

Objective-C:

Download:

https://github.com/google/protobuf/releases/download/v3.0.0-beta-3/protobuf-objectivec-3.0.0-beta-3.zip

Install:
$ objectivec/DevTools/full_mac_build.sh
Building:

There are two ways to include the Runtime sources in your project:

Add objectivec/\*.h & objectivec/GPBProtocolBuffers.m to your project.

or

Add objectivec/\*.h & objectivec/\*.m except for
objectivec/GPBProtocolBuffers.m to your project.

If the target is using ARC, remember to turn off ARC (-fno-objc-arc) for the
.m files.

The files generated by protoc for the *.proto files (\*.pbobjc.h' and
*.pbobjc.m`) are then also added to the target.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值