美文网首页
Ubuntu16.04 编译protobuf及安装

Ubuntu16.04 编译protobuf及安装

作者: 姑娘请别为难小僧 | 来源:发表于2019-08-13 16:24 被阅读0次

首先确保你的gcc版本没有改过
gcc -v查看gcc版本


image.png

不然会报错
error: *** A compiler with support for C++11 language features is required

1.下载
https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protobuf-cpp-3.9.1.tar.gz

  1. 解压 并cd protobuf-3.9.1
  2. sudo apt-get install autoconf automake libtool curl make g++ unzip
  3. ./autogen.sh
  4. ./configure
  5. make
  6. make check
  7. sudo make install
  8. sudo ldconfig
  9. protoc --version

使用:
protoc --java_out=./ *.proto

相关文章

网友评论

      本文标题:Ubuntu16.04 编译protobuf及安装

      本文链接:https://www.haomeiwen.com/subject/pyjbjctx.html