准备

#mac 确保安装了 gcc+ gcc-c++
brew install automake
brew install libtool#centos
yum -y install gcc+ gcc-c++
yum install automake
yum install libtool

1. mac 环境

1.1 使用brew安装

brew install protobuf

此方法安装的protobuf 目前版本是3.7 比较新,如果想安装低版本,可以先执行 brew search protobuf ,搜索可安装版本,然后安装相应版本即可。由于我需要安装2.5版本,没有可安装版本,所以使用下面方法安装。

1.2 tar.gz安装

wget https://github.com/protocolbuffers/protobuf/archive/v2.5.0.tar.gz
tar -zxf v2.5.0.tar.gz
cd protobuf-2.5.0
./autogen.sh
./configure --prefix=/opt/protobuf-2.5.0
make
make install

备注:

下载tar包地址我使用的是GitHub地址,网上有提供 http://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz 地址,我无法下载,不知道是个例还是资源已经无法下载了。

执行 ./autogen.sh 会遇到,无法下载谷歌的gtest卡在那里。解决方式就是修改 autogen.sh脚本。

#原文 22 23行删除
21 echo "Google Test not present. Fetching gtest-1.5.0 from the web..."22 curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx
23 mv gtest-1.5.0 gtest#替换下面内容,这里采用 wget 命令下载,使用1.5版本是因为原文 21 行,地址如果有错误请使用GitHub上的下载地址wget https://github.com/google/googletest/archive/release-1.5.0.tar.gz tar xzvf release-1.5.0.tar.gzmv googletest-release-1.5.0 gtest

2.centos环境

安装类似于mac环境tar.gz安装方式。

转载于:https://www.cnblogs.com/xiaopan-cp9/p/10868978.html

安装protobuf相关推荐

  1. ubuntu安装protobuf

    这个安装没成功: 参考:https://blog.csdn.net/Zyong139064359/article/details/102543602 如果是Ubuntu子系统,在clone开始就在子系 ...

  2. protobuf2和3同时安装_在 Ubuntu 上安装 Protobuf 3 的教程详解

    什么时候需要安装 如果使用 protoc 命令,遇到 Protoc not found,表示未安装.或者,执行时出现错误:This parser only recognizes "proto ...

  3. 1004.ubuntu16.04 安装protobuf

    1  在线安装protobuf 依赖库  sudo apt-get install autoconf automake libtool curl make g++ unzip 2  下载源码 git ...

  4. Mac安装protobuf 流程

    1.brew安装protobuf 1.安装brew ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/inst ...

  5. 解压并安装protobuf库_golang-leaf服务器-protobuf的安装

    json和protobuf 2种,我这里选择protobuf 源码地址: golang/protobuf​github.com 1. 安装编译器protoc protocolbuffers/proto ...

  6. 【库安装】windows下Python安装protobuf

    Windows下安装protobuf https://github.com/protocolbuffers/protobuf/releases 1.到上边的网址能找到一个包,下载下面图中的两个包 2. ...

  7. 非root用户安装protobuf的python依赖到指定目录

    在github中搜索protobuf,选择google/protobuf,按照readme中的说明,安装python版本的protobuf.如果是非root用户,没有对默认目录的写入权限,需要修改一下 ...

  8. protobuf java linux_linux下安装protobuf及其使用

    linux下安装protobuf及在python与php上的应用 下载解压源文件 github上的版本发布地址 https://github.com/protocolbuffers/protobuf/ ...

  9. pip 安装protobuf_Python3.6安装protobuf模块+将proto文件转换成pb2.py文件

    Python对版本的对应即为苛刻,笔者第一次安装时遇到了很多坑,比如无法将proto文件转换成py文件,转换了之后文件无法使用,网上各种各样的解决办法都没有讲到重点.其实会出现各种各样的问题是由于版本 ...

  10. golang安装protobuf以及go-micro

    参照网上的教程安装一直提示proto-gen和proto-micro找不到路径,后面看了下这位大佬的教程之后安装成功,因此做了下整理记录在此: #安装库 go get -u github.com/mi ...

最新文章

  1. 【RPA干货来袭】 UiBot关于如何使用浏览器调用JS命令的说明
  2. 关于 varchar2 的最大长度
  3. 对std::listT的封装
  4. C#实现利用单选框实现更改文本的richTextBox字体、大小、加粗
  5. 【build your own xxx】实现你自己的bind函数
  6. mysql数据库二级233_2013年计算机等级二级mysql数据库模拟试题及答案
  7. 文本处理命令系列——cut
  8. Python中List,tuple,Dictionary之间的区别
  9. 如何通过 WinUSB 功能访问 USB 设备
  10. 时间序列分析-AR模型
  11. Unity3D官方案例--太空射击游戏总结
  12. 外文图书免费下载网站
  13. 加州大学戴维斯分校 计算机科学,加州大学戴维斯分校计算机科学硕士设置
  14. Waterfall Scrum
  15. FMC150-两路250Msps AD、两路500Msps DA FMC子卡模块
  16. IT 猎头分享---找工作前你真得想清楚离职原因了吗?
  17. 从sql注入到getshell (内附sqlmap的os-shell遇到中文路径的解决办法)
  18. onclick绑定多事件
  19. python篇 深拷贝与浅拷贝
  20. Git使用教程:完全图解!

热门文章

  1. JavaScript实现图片上传并预览并提交
  2. mongo的‘模糊匹配’
  3. 解决JavaScript浮点数(小数) 运算出现Bug的方法
  4. 用HE提供的免费DNS解析服务通过IPv6 DNS检测
  5. DiskFileItemFactory
  6. php.ini_中文详解
  7. Gradle Guide
  8. 【学习笔记9】Linux常用命令6 - 压缩解压命令
  9. MyEclipse创建Maven工程
  10. 如何解决logcat TAG过长时Android studio提示错误的问题