protobuf

详解protobuf-从原理到使用

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.15.3/protobuf-all-3.15.3.tar.gz
tar -xvf protobuf-3.15.3.tar.gz
cd protobuf-3.15.3
./configure
make -j8

cd protobuf-3.15.3
cp src/protoc /usr/local/bin

#for Python
cd Python
python3 setup.py install
#生成接口文件
protoc -I=$SRC_DIR --python_out=/root/xiao addressbook.proto

#for CPP
make install
protoc -I=$SRC_DIR --cpp_out=. addressbook.proto