ubuntu14.04 32bit下编译protobuf-2.6.0

备注:以下所有命令均使用root权限执行;

2、解压 tar -xzvf protobuf-2.6.0.tar.gz得到protobuf-2.6.0,再解压gtest得到gtest-1.5.0,复制到protobuf-2.6.0目录并重命名为gtest
3、cd protobuf-2.6.0
4、./autogen.sh 如果提示autoconf not found,请执行apt-get install autoconf安装
5、./configure
6、上一步可能会出现如下错误(解决方法:sudo apt-get install libtool & libsysfs-dev):
configure.ac:17: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate,please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

7、make
8、make install
9、测试是否安装ok,protoc --version

没有错误则会显示正确的版本号,如果有如下错误,请解决之
protoc: error while loading shared libraries: libprotoc.so.8: cannot open shared
错误原因:
protobuf的默认安装路径是/usr/local/lib,而/usr/local/lib 不在Ubuntu体系默认的 LD_LIBRARY_PATH 里,所以就找不到该lib
解决方法:
① echo "/usr/local/lib" >> /etc/ld.so.conf.d/libprotobuf.conf
② sudo ldconfig

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...