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 ...
随机推荐
- 对 dotweb 框架进行统一的自定义错误处理
助移动端的增长,如今 RESTful 风格的 API 已经十分流行, 用各种语言去写后端 API 都有很成熟方便的方案,用 golang 写后端 API 更是生产力的代表, 你可以用不输 python ...
- 基于FPGA的均值滤波算法的实现
前面实现了基于FPGA的彩色图像转灰度处理,减小了图像的体积,但是其中还是存在许多噪声,会影响图像的边缘检测,所以这一篇就要消除这些噪声,基于灰度图像进行图像的滤波处理,为图像的边缘检测做好夯实基础. ...
- 用java实现给图片增加图片水印或者文字水印(也支持视频图像帧添加水印)
javaCV图像处理系列: javaCV图像处理之1:实时视频添加文字水印并截取视频图像保存成图片,实现文字水印的字体.位置.大小.粗度.翻转.平滑等操作 javaCV图像处理之2:实时视频添加图片水 ...
- Dojo初探之2:设置dojoConfig详解,dojoConfig参数详解+Dojo中预置自定义AMD模块的四种方式(基于dojo1.11.2)
Dojo中想要加载自定义的AMD模块,需要先设置好这个模块对应的路径,模块的路径就是这个模块的唯一标识符. 一.dojoConfig参数设置详解 var dojoConfig = { baseUrl: ...
- 表单的get和post使用情景
GET和POST两种方法都是将数据送到服务器,但你该用哪一种呢? HTTP标准包含这两种方法是为了达到不同的目的.POST用于创建资源,资源的内容会被编入HTTP请示的内容中.例如,处理订货表单.在数 ...
- 【论文:麦克风阵列增强】Microphone Array Post-Filtering For Non-Stationary Noise Suppression
作者:桂. 时间:2017-06-08 08:01:41 链接:http://www.cnblogs.com/xingshansi/p/6957027.html 原文链接:http://pan.ba ...
- KNN算法介绍
KNN算法全名为k-Nearest Neighbor,就是K最近邻的意思. 算法描述 KNN是一种分类算法,其基本思想是采用测量不同特征值之间的距离方法进行分类. 算法过程如下: 1.准备样本数据集( ...
- (cljs/run-at (JSVM. :browser) "搭建刚好可用的开发环境!")
前言 书接上一回,在了解cljs基本语法后并在clojurescript.net的奇特错误提示后,我们必须痛定思痛地搭建一个本地的开发环境,以便后续深入地学习cljs. 现有的构建工具 由于浏览器 ...
- Android 4.0以后正确的获取外部sd卡存储目录
刚解决这个棘手的问题 找了很久,随笔记下. 网上搜索 android 获取外部sd卡存储目录 普遍都是: 1) Environment.getExternalStorageDirectory() 这个 ...
- Web前端总结(小伙伴的)
以下总结是我工作室的小伙伴的心得,可以参考一下 html+css知识点总结 HTMl+CSS知识点收集 1.letter-spacing和word-spacing的区别 letter-spacing: ...