LINUX(centos6.0)下编译安装PROTOBUF

来源:互联网 发布:管理孩子上网软件 编辑:程序博客网 时间:2024/06/07 19:37

已经在centos6.0上测试通过

下载protobuf-2.5.0.tar.gz:
http://code.google.com/p/protobuf/downloads/list
安装:
tar zxvf protobuf-2.5.0.tar.gz

cd protobuf-2.5.0
./configure  --prefix /usr/local/protobuf   //protobuf路径需要提前创建
make
make check
make install
安装结束。
验证:
查看是否安装成功:protoc --version
如果出现:libprotoc 2.5.0 则说明安装成功!
如果出现错误:

protoc: error while loading shared libraries: libprotobuf.so.0: cannot open
shared object file: No such file or directory
The issue is that Ubuntu 8.04 doesn't include /usr/local/lib in
library paths.
 
To fix it for your current terminal session, just type in

 

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

 

 

动态库路径指定上面的命令只是暂时有效,如果需要永久设置,请关注我另一篇文章。

原创粉丝点击