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. PHP初体验

    PHP初体验 提笔写初体验总不知道从何说起,直接聊PHP中的函数.PHP网络技术.数据库操作.PHP模板等感觉又不是初体验.最后还是决定从PHP的面向对象.PHP的魔术方法.PHP的反射.PHP中的异 ...

  2. 解析PHP面向对象的三大特征

    class BenHang extends Card{ /*构造函数与及构造的继承*/ function __construct($cardno,$pwd, $name,$money){ parent ...

  3. Unity 打包总结和资源的优化和处理

    1. Texture,都去掉alpha通道,作为背景展示的图片,基本都没有透明要求,有特殊要求的则放到atlas里面 a. Loading图这类需要比较精细的,则把图片设置为Automatic Tru ...

  4. 关于dedecms的操作

    系统基本参数的配置 如图 上面是设置系统的基本参数 操作是进入系统后台>点击系统>点击系统基本参数  然后右边就是系统参数等等基本参数了 记住修改后要点击确定哟 ☺ 数据库备份  如图: ...

  5. 《学习OpenCV3》第7章第4题-SVD奇异值分解的验算

    原文题目: 中文翻译:   解题过程 d.使用OpenCV编写代码 , ,               , ,               ,);     Mat A = static_cast< ...

  6. Asp.net MVC 如何对所有用户输入的字符串字段做Trim处理

    经常需要对用户输入的数据在插入数据库或者判断之前做Trim处理,针对每个ViewModel的字段各自做处理是我们一般的想法.最近调查发现其实也可以一次性实现的. MVC4.6中实现方式 1,实现IMo ...

  7. tomcat之 Tomcat 7.0.78 单机多实例配置

    前言:JDK(JavaDevelopment Kit)是Sun Microsystems针对Java开发员的产品.自从Java推出以来,JDK已经成为使用最广泛的javaSDK. JDK是整个Java ...

  8. H5 web 存储之 Webstorage

    H5提供了两种在客户端存储数据的方式:localStorage 持久化的本地存储(浏览器关闭重新打开数据依然存在)sessionStorage 针对一个session的本地存储之前这些都是由cooki ...

  9. SICP-1.6-高阶函数

    高阶函数 将函数作为参数 例如 def sum_naturals(n): total, k = 0, 1 while k <= n: total, k = total + k, k + 1 re ...

  10. IBM芯片新功能:诊断癌症

    治愈任何疾病的最好方法是什么?-------------- 当然是把它扼杀在摇篮里. "早发现早治疗"已经是老生常谈,但要准确监测疾病又谈何容易?不过现在,IBM这枚小小的芯片就能 ...