源码获取
-
从发行版直接下载cpp(或者对应语言)的包
发行版下载地址:https://github.com/protocolbuffers/protobuf/releases/latest可以直接下载
-
从github获取release构建
GitHub:https://github.com/protocolbuffers/protobuf
fork到gitee:https://gitee.com/huzbin/protobuf.git
选择tag,发行版(release)下载tar.gz,如图
- 直接从github获取最新源码
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
编译源码
# 安装需要的软件
sudo apt-get install autoconf automake libtool curl make g++ unzip
# 解压
$tar zxvf protobuf-v3.13.0.tar.gz
#编译
$ cd protobuf-3.13.0
$ ./autogen.sh #如果下载的对应语言的包则不需要
$ ./configure
$ make -j4
$ make install
$ ldconfig
$ protoc --version# 查看版本号
参考文档
C++安装参考:https://gitee.com/huzbin/protobuf/blob/master/src/README.md
autoconf:http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/autoconf.html
u/autoconf/manual/autoconf-2.69/autoconf.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/137665.html