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 2.1 ...
- 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 ...
随机推荐
- 如何:创建签名的友元程序集(C# 和 Visual Basic)
如何:创建签名的友元程序集(C# 和 Visual Basic) Visual Studio 2013 本示例演示了如何将友元程序集和具有强名称的程序集一起使用. 这两种程序集必须都使用强名称. ...
- PHP phpMyadmin数据库备份太大无法导入怎么
1 如图所示,phpMyAdmin的数据库最大只能8M,大于这个体积就无法导入 2 你可以从以下网站下载这个软件Navicat for MySQL, http://www.pb86.net/soft/ ...
- 【Cocos2d-x 3.0】游戏开发之android交叉编译
作者:Senlern 转载请注明,原文链接:http://blog.csdn.net/zhang429350061/article/details/37959489 在上一篇文章我分享了如在win32 ...
- 使用 RDVTabBarController 制作底部凸起的 TabBar 笔记
欢迎訪问我的个人博客http://mmoaay.photo/ 本文主要针对底部凸起的 TabBar 这样的特殊需求,不感兴趣的能够直接绕过- 近期做的一个项目须要底部凸起的 TabBar,效果例如以下 ...
- 阿里云服务器 centos7 ftp安装
昨天租了阿里云服务器一个月,想玩一下linux系统,结果想用ftp上传本地文件的时候,发现用不了,结果在安装配置的时候折腾了几个小时,在网上查了无数的资料,有的说要改配置文件,有的说要关防火墙,说啥的 ...
- 亲热接触Redis-第二天(Redis Sentinel)
简单介绍 经过上次轻松搭建了一个Redis的环境并用Java代码调通后.这次我们要来看看Redis的一些坑以及Redis2.8以后带来的一个新的特性即支持高可用特性功能的Sentinel(哨兵). R ...
- oracle 存储过程 返回结果集
oracle 存储过程 返回结果集 CreationTime--2018年8月14日09点50分 Author:Marydon 1.情景展示 oracle存储过程如何返回结果集 2.解决方案 最简 ...
- 【Oracle】查看正在运行的存储过程
select name from v$db_object_cache where locks > 0 and pins > 0 and type='PROCEDURE';
- 常用Jar包下载
Jackson包下载 :https://yunpan.cn/cBdPGeIESZ4jE 访问密码 36f7
- 【LeetCode】85. Maximal Rectangle
Maximal Rectangle Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle conta ...