Linux下protobuf的编译与安装【各种奇葩问题】
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的编译与安装【各种奇葩问题】的更多相关文章
- Linux下protobuf的编译与安装
1.下载源码 首先,从github上下载protobuf的源码,地址:https://github.com/google/protobuf,我选择下载2.5.0版本. 2.编译protobuf 将下载 ...
- Linux下OSG的编译和安装以及遇到的问题
(第一段日常扯蛋,大家不要看)由于我们教研室所做的RTMapper要用到GDAL,所以就打算看osgearth的源码来熟悉下GDAL库的使用,同时也了解下osgearth中关于带有高程的图像拼接.然而 ...
- linux下ACE的编译与安装
1.环境变量的设置vim /etc/profile 2.然后输入export ACE_ROOT=/root/ACE/ACE_wrappers export MPC_ROOT=$ACE_ROOT/MPC ...
- Linux下指定版本编译安装LAMP
说明: 操作系统:CentOS 6.5 64位 需求: 编译安装LAMP运行环境 各软件版本如下: MySQL:mysql-5.1.73 Apache:httpd-2.2.31 PHP:php-5.2 ...
- Linux下非root用户如何安装软件
Linux下非root用户如何安装软件 从windows转移到Linux的用户最开始总会有各种不适,因为这种不适最终放弃linux的不在少数.对于这类人只能说可惜,还没有领略到linux的美好就过早放 ...
- linux下使用非root账号安装zabbix-client
linux下使用非root账号安装zabbix-client使用非root账号rusky登录:[rusky@testServer]#tar zxvf zabbix-2.4.5.tar.gz #cd z ...
- Linux下使用javac编译
Linux下使用javac编译Hadoop程序 首先要配置好Hadoop, 给出两个教程 Hadoop安装教程单机/伪分布式配置Hadoop2.6.0/Ubuntu14.04 Hadoop集群安装配置 ...
- linux下各安装包的安装方法
<转>linux下各安装包的安装方法 一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root ...
- linux下搭建lamp环境以及安装swoole扩展
linux下搭建lamp环境以及安装swoole扩展 一.CentOS 6.5使用yum快速搭建LAMP环境 准备工作:先更新一下yum源 我安装的环境是:apache2.2.15+mysql5 ...
随机推荐
- GPU编程--Shared Memory(4)
GPU的内存按照所属对象大致分为三类:线程独有的.block共享的.全局共享的.细分的话,包含global, local, shared, constant, and texture memoey, ...
- HTML面试题
1.你做的页面在哪些流览器测试过?这些浏览器的内核分别是什么? 所谓的“浏览器内核”无非指的是一个浏览器最核心的部分-“Rendering Engine”,直译叫做“渲染引擎”,我们也常称为“排版引擎 ...
- python基础操作_元组_字典操作
#元组'''元组是不可变的列表,不能改.取值和列表一样'''tp=(1,2,3)tp1=('127.0.0.1','3307')#元组只有count 和index两个方法.lis=['127.0.0. ...
- SpringMVC的form:form表单的使用
为什么要使用SpringMVC的form:form表单,有两个原因:一是可以更加快捷的完成表单的开发,比如会替你做好数据类型装换等本来需要你自己动手的工作.其次就是能够更加方便的实现表单回显. 首先要 ...
- js变量提升和函数提升
变量,作为编程语言最基础的部分,每种语言的变量不尽相同,但又大径相庭.大部分编程语言的变量有块级作用域,如if.for.while... 但JavaScript不纯在块级作用域,而是函数作用域,并且有 ...
- ecshop收货地址货到付款修改
用户选择某些地址时,支付方式里则可以依据此地址来对货到付款选项进行显示或隐藏.目前仅与顺丰合作,以顺丰提供的数据为准. 使用到的数据库分别如下: ecs_region//地方数据,PRIMARY KE ...
- Windows系统前端常用PS快捷键:
1.设置滚轮放大缩小: 编辑--首选项--常规--用滚轮缩放 2.V 移动 ctrl+v 自动选中(图层), 3.M 选框 Shift+M 变换形状 Alt :确定圆形/矩形中心 Shift: 圆形/ ...
- Compare and Swap [CAS] 算法
一个Java 5中最好的补充是对原子操作的支持类,如AtomicInteger,AtomicLong等.这些类帮助你减少复杂的(不必要的)多线程代码,实际上只是完成一些基本操作,如增加或减少多个线程之 ...
- 蜘蛛大战之 站点LOGO(SEO)
起因: 同事让我看 搜公司名称,百度第一位并没有出现公司网址,是别人的,然后我 惊奇的发现,站点logo 竟然 抓了张 无关紧要的图片,从此 变开始了 为期 10天+的战争: 经过: [2017-06 ...
- jenkins管理员密码登录不了
1.密码管理员密码,如何修改 进入/var/jenkins_home/users/admin目录下修改config.xml文件: 以下密码是admin <hudson.security.Huds ...