protobuf
protobuf是一种比json和xml等序列化工具更加轻量和高效的结构化数据存储格式,性能比json和xml真的强很多。
protobuf的原理
- 安装步骤
- git clone https://github.com/protocolbuffers/protobuf.git
- sudo apt-get install autoconf automake libtool curl make g++ unzip libffi-dev -y
- cd protobuf
- ./autogen.sh
- ./configure
- make
- sudo make install
- sudo ldconfig(重要)
protobuf详细安装
1.首先执行这个命令来下载protobuf(下载速度可能有点慢)
git clone https://github.com/protocolbuffers/protobuf.git
下载完了之后我们就可以看到protobuf这个目录
2.需要再安装一个依赖库 执行以下命令
sudo apt-get install autoconf automake libtool curl make g++ unzip libffi-dev -y
如果没有执行这段命令,那么就会遇到这种情况
所以先安装这个依赖库
3 .进入到我们下载的protobuf目录,然后执行命令
./autogen.sh
4.执行
./configure
5.执行
make
6.执行
sudo make install
最后再执行(这个很重要)
sudo ldconfig
这样安装就完成了,那么我们可以通过输入 pro + TAB键
或者通过protoc --version来查看也可以
安装就完成了