1.下载源码

首先,从github上下载protobuf的源码,地址:https://github.com/google/protobuf,我选择下载2.5.0版本。

2.编译protobuf

将下载的压缩包解压缩

unzip protobuf-2.5..zip

根目录下没有configure文件,却有一个autogen.sh,原来是因为protobuf的编译方式做了修改,要执行autogen.sh才会生成configure脚本。

但在执行autogen.sh时出错了,因为google.com被墙了,虚拟机里无法下载gtest,于是手动下载googletest-release-1.5.0.zip,解压缩后,改名为gtest放在protobuf-2.5.0目录下 
autgen.sh代码片段

 # Check that gtest is present.  Usually it is already there since the
# directory is set up as an SVN external.
# 判断是否存在gtest目录
if test ! -e gtest; then
echo "Google Test not present. Fetching gtest-1.5.0 from the web..."
#如果目录不存在则尝试从google.com下载并解压缩,如果google被墙则下载失败
curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx
#将解压缩后的目录改名为gtest
mv gtest-1.5. gtest
fi

googletest1.5.0下载地址:https://github.com/google/googletest

 解压缩

 unzip gtest-1.5..zip
mv gtest-1.5. gtest

执行protobuf编译

#执行autogen.sh生成configure
又是一堆的错误!!! 运行./autogen.sh时(用于产生configure,) 出现错误:

 linux-lewph:/home/lewph/Projects/System/build_tslib/tslib # ./autogen.sh
./autogen.sh: line : autoreconf: command not found

缺少autoconf这个工具安装:

 yum install -y  autoconf

再次运行./autogen.sh问题又来了:

 linux-lewph:/home/lewph/Projects/System/build_tslib/tslib # ./autogen.sh
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory
 linux-lewph:/home/lewph/Projects/System/build_tslib/tslib # ./autogen.sh
Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory   有这个文件,推测,问题出现在exec "aclocal"这里,

用cnf查一下,linux-lewph:/home/lewph/Projects/System/build_tslib/tslib # cnf aclocal

The program 'aclocal' can be found in following packages:
* automake [ path: /usr/bin/aclocal, repository: zypp (repo-oss) ]
* automake [ path: /usr/bin/aclocal, repository: zypp (openSUSE 11.2-) ]

安装依赖

 yum  install automake

原来是要用到automake这个工具!安装之!完成以后,再运行./autogen.sh .      问题还有!!!:

 linux-lewph:/home/lewph/Projects/System/build_tslib/tslib # ./autogen.sh
configure.ac:: error: possibly undefined macro: AC_DISABLE_STATIC
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.ac:: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status:

这是缺少安装包libtool-1.5.22.tar.gz 安装

yum install -y libtool

3.安装protobuf

 ./autogen.sh
./configure
 make
make check
 sudo make install

 4.成功

    

Linux下protobuf的编译与安装【各种奇葩问题】的更多相关文章

  1. Linux下protobuf的编译与安装

    1.下载源码 首先,从github上下载protobuf的源码,地址:https://github.com/google/protobuf,我选择下载2.5.0版本. 2.编译protobuf 将下载 ...

  2. Linux下OSG的编译和安装以及遇到的问题

    (第一段日常扯蛋,大家不要看)由于我们教研室所做的RTMapper要用到GDAL,所以就打算看osgearth的源码来熟悉下GDAL库的使用,同时也了解下osgearth中关于带有高程的图像拼接.然而 ...

  3. linux下ACE的编译与安装

    1.环境变量的设置vim /etc/profile 2.然后输入export ACE_ROOT=/root/ACE/ACE_wrappers export MPC_ROOT=$ACE_ROOT/MPC ...

  4. Linux下指定版本编译安装LAMP

    说明: 操作系统:CentOS 6.5 64位 需求: 编译安装LAMP运行环境 各软件版本如下: MySQL:mysql-5.1.73 Apache:httpd-2.2.31 PHP:php-5.2 ...

  5. Linux下非root用户如何安装软件

    Linux下非root用户如何安装软件 从windows转移到Linux的用户最开始总会有各种不适,因为这种不适最终放弃linux的不在少数.对于这类人只能说可惜,还没有领略到linux的美好就过早放 ...

  6. linux下使用非root账号安装zabbix-client

    linux下使用非root账号安装zabbix-client使用非root账号rusky登录:[rusky@testServer]#tar zxvf zabbix-2.4.5.tar.gz #cd z ...

  7. Linux下使用javac编译

    Linux下使用javac编译Hadoop程序 首先要配置好Hadoop, 给出两个教程 Hadoop安装教程单机/伪分布式配置Hadoop2.6.0/Ubuntu14.04 Hadoop集群安装配置 ...

  8. linux下各安装包的安装方法

    <转>linux下各安装包的安装方法   一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root ...

  9. linux下搭建lamp环境以及安装swoole扩展

    linux下搭建lamp环境以及安装swoole扩展   一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源  我安装的环境是:apache2.2.15+mysql5 ...

随机推荐

  1. SQL万能语句-经典操作

    一.基础 1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备 ...

  2. 活动页怎么切图photoshop

    一 切固定大小的单个图片 1.用pc打开图像 2.按ctrl+A(全选) 3.点击 选择 ->变换选区 ->拉参考线(把参考线放到最中央)->按回车 ->ctrl+d(取消全选 ...

  3. 实现容器的底层技术 - 每天5分钟玩转 Docker 容器技术(30)

    为了更好地理解容器的特性,本节我们将讨论容器的底层实现技术.cgroup 和 namespace 是最重要的两种技术.cgroup 实现资源限额, namespace 实现资源隔离. cgroup c ...

  4. Easyui设置动态表格,动态导出数据实例,附Dome

    最近碰到一个需求,需要提供一个弹出页面选择列表页面需要显示的列,页面确认之后需要修改列表页面显示的表格,导出的数据也需要同步变化. 下面直接上代码 1.设置需要显示的列columus为全局对象,用于子 ...

  5. ecshop图片上传JPEG格式失败问题

    在根目录下找到includes文件目录,在其目录中找到cls_image.php打开并找到: $allow_file_types = '|GIF|JPG|JEPG|PNG|BMP|SWF|'; 此处J ...

  6. 基于Mac制作iPhone铃声教程,iTunes定制铃声

    前言: 网上太多制作方法了,不管是借助第三方软件还是基于iTunes的,不过这些方法都太旧了,有时看起来 ,界面的变化或其他原因,导致很不爽. 正好记录下我最近使用的一种方法: 正文: 一.下载你需要 ...

  7. dubbo与zookeeper的关系

    Dubbo建议使用Zookeeper作为服务的注册中心. 1.   Zookeeper的作用: zookeeper用来注册服务和进行负载均衡,哪一个服务由哪一个机器来提供必需让调用者知道,简单来说就是 ...

  8. promise(3) '静态'方法

    要是人没有梦想,跟咸鱼又有什么两样了?一直恐惧读源码,哪怕是一个简单的库也是读百来行遇到难点就放弃了.对于新的东西也仅仅是知道它拿来干什么,社区资源在哪里,要用时就突击文档资源使用即可.未有过深入之心 ...

  9. WebService小记

    这个问题找了好多地方都没有结果,自己暂且总结一下吧,也不算是解决问题的根本途径,但是也不失为一种办法.当时用了wsimport  wsdl2java xfire 都没有解决,大牛能解决的话,欢迎留言. ...

  10. SpringMVC转发和重定向区别!

    在servlet中,转发和重定向是由request和response完成的.两者之间的区别请看我之前的文章.那么在springMVC中是如何完成的呢? /**转发**/ @RequestMapping ...