您的位置:首页 > 运维架构 > Linux

centos 安装 protobuf

2015-11-23 14:47 519 查看
今天在一台新的服务器(centos)上安装protobuf

protobuf在github上的源码:https://github.com/google/protobuf

clone地址:https://github.com/google/protobuf.git

protobuf我的百度网盘地址: http://pan.baidu.com/s/1mgtTccK
下载后,网上都说让你./configure,实际上现在的版本好像暂时没这个文件,我们需要自己打开README看看,里面说让先运行./autogen.sh,但当运行的时候又说要先弄个gmock,如果您的服务器可以直接访问墙外还好说,如果不行,就又不成了。

我打开autogen.sh,发现它是要下载个文件,并解压到当前:

curl $curlopts -O https://googlemock.googlecode.com/files/gmock-1.7.0.zip
unzip -q gmock-1.7.0.zip

rm gmock-1.7.0.zip

mv gmock-1.7.0 gmock

我们可以选择直接区这个网址下载,或者用wget,或者您也可以用我网盘里的这个:

gmock: http://pan.baidu.com/s/1c0kFRXI
上面的完成之后,再运行./autogen.sh, 这时候再./configure ,

make

make check

make install

就可以了。

2016.06.23更新:

最新安装过程如下:

git clone https://github.com/google/protobuf.git cd protobuf/
git clone https://github.com/google/googlemock.git mv googlemock gmock
./autogen.sh
./configure
make
make check
make install
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib64:/usr/lib64
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: