ProtocolBuffers在Mac OS的安装

一、检查环境

1
2
//安装autoconf、automake、libtool工具
brew install autoconf automake libtool

二、安装步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//1.clone源码
git clone https://github.com/google/protobuf.git
//2.进入项目目录
cd protobuf
//3.生成configure脚本
./autogen.sh
//4.安装
./configure
make
make check
sudo make install
//5.配置protoc的环境变量,即protobuf项目的目录路径
略。
//6.可略过
sudo ldconfig # refresh shared library cache.

三、检查是否安装成功

1
protoc --version