mac上安装protobuf2.5.0
在github上找到相应版本,下载protobuf2.5.0
https://github.com/google/protobuf/releases?after=v3.0.0-alpha-4.1
解压:
tar -zxf protobuf-2.5.0.tar.gz
cd:
cd protobuf-2.5.0
设置编译目录:
./configure --prefix=/Users/hulb/opt/third/protobuf
-- 备注:
-- /Users/hulb/opt/third/protobuf
为自己设定的编译安装目录
安装:
make
执行完毕后,执行:
make install
配置环境变量:
vim ~/.bash_profile
添加配置文件:
export PROTOBUF=/Users/hulb/opt/third/protobuf
export PATH=$PROTOBUF/bin:$PATH
测试:
protoc --version