linux安装protoc
protobuf 是做什么的?
专业的解答:
Protocol Buffers 是⼀种轻便⾼效的结构化数据存储格式,可⽤于结构化数据串⾏化,很适合做数据存储或 RPC 数据交换格式。
它可⽤于通讯协议、数据存储等领域的语⾔⽆关、平台⽆关、可扩展的序列化结构数据格式。简单的说就是⼲和xml⼀样的事,把某种数据结构的信息,以某种格式保存起来。主要⽤于数据存储、传输协议格式等场合
protobuf 如何安装?
下载安装包
1、⾸先确定⾃⼰当前linux版本(当前版本为x86_64)
include意思uname -a
Linux localhost.localdomain 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2、选择相应的版本下载并解压到当前⽬录
wget github/protocolbuffers/protobuf/releases/download/v3.14.0/protoc-3.14.0-linux-x86_64.zip
unzip protoc-3.14.0-linux-x86_64.zip
3、安装 protoc
解压protoc压缩包后,可以看到⽂件
Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc.
le/protocol-buffers/
This package contains a precompiled binary version of the protocol buffer
compiler (protoc). This binary is intended for users who want to use Protocol
Buffers in languages other than C++ but do not want to compile protoc
themselves. To install, simply place this binary somewhere in your PATH.
If you intend to use the included well known types then don't forget to
copy the contents of the 'include' directory somewhere as well, for example
into '/usr/local/include/'.
Please refer to our official github site for more installation instructions:
github/protocolbuffers/protobuf
⼤致意思是安装protoc,只需将bin⽬录下的⼆进制⽂件放在某个位置就⾏,如果你打算⽤其中的包含的其他类型,同时需要将include⽬录的内容也复制到某个地⽅,例如输⼊/usr/local/include/
我们把protoc放在/usr/local/bin可执⾏程序⽬录中,这样全局都可以访问到,同时把include⽬录的内容也复制到/usr/local/include/中
# 移动安装proto (cd到解压⽬录bin中后执⾏)
mv proto /usr/local/bin
# 把`include`⽬录的内容复制(cd到解压⽬录include中后执⾏)
cp google /usr/local/include
protoc --version
libprotoc 3.14.0
安装完成!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论