gRPC 编译与安装。
系统环境
- Ubuntu 20.04
- gRPC v1.34.0
gRPC 该版本在 Ubuntu 22.04 下编译出错。
安装依赖、Clone 仓库
1 | sudo apt install -y build-essential autoconf libtool \ |
编译
一起编译其他依赖库,不需要额外安装。
1 | cd grpc |
proto 文件生成命令
1 | protoc --cpp_out=./include --grpc_out=./include --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` -I./proto db.proto |