首先确保你的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
- 解压 并cd protobuf-3.9.1
- sudo apt-get install autoconf automake libtool curl make g++ unzip
- ./autogen.sh
- ./configure
- make
- make check
- sudo make install
- sudo ldconfig
- protoc --version
使用:
protoc --java_out=./ *.proto
网友评论