protobuf在iOS中得使用

来源:互联网 发布:树熊网络登录 编辑:程序博客网 时间:2024/06/05 08:08

1.运行脚本 https://gist.github.com/BennettSmith/7150245

2.编写 .proto 文件

3.把/protobuf/platform/platform/libprotobuf.a 添加到工程里

4.把/protobuf/include下的google文件添加到工程

5.配置Header Search Paths 和User Header Search Paths  为"$(SRCROOT)/项目名/(google文件的上层目录)"

6.用/protobuf/bin下的protoc编译.proto文件 命令行 :/protobuf/bin/protoc --cpp_out=. -I=. name.proto把生成的 .pb.cc文件和 .pb.h文件添加到工程里

(mac osx环境下使用su root进入管理员权限下)

0 0
原创粉丝点击