由于工程中proto语法采用的是2.0的,所以选择安装2.6.1版本的protobuf。(3.0和2.0语法不同,如果安装3.0以上版本的protobuf,在编译的时候应该需要增加啥~~~)
编译安装步骤:
1. 安装 protobuf 依赖项, 其依赖于autoconf、 automake、 libtool ,使用brew info 检查是否安装,如果没有安装,请依次执行brew install autoconf、brew install automake、brew install libtool
2. 确认依赖项已经正确安装,下载protobuf 2.6.1 文件夹(https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz),下载后解压到自己想要放置的路径
3. 下载protobuf文件编译的依赖项gtest,https://github.com/google/googletest/tree/release-1.5.0 , 下载后解压,更改文件名为gtest,放置在protobuf文件夹下
3. cd protobuf-2.6.1