下载源码

版本:protobuf-cpp-3.21.1.zip

编译源码

# 创建安装目录
mkdir -p /share/protobuf/__install

#配置生成makefile
./configure --prefix=/share/protobuf/__install CC=aarch64-rockchip-linux-gnu-gcc CXX=aarch64-rockchip-linux-gnu-g++ CXXFLAGS="-fPIC" --host=arm-linux

# 编译
make -j 2
 
# 安装
make install