ubuntu下安装配置grpc

目录

1.准备环境

 2.安装protobuf

3.安装cares库

3.安装grpc-1.17.x


1.准备环境

sudo apt-get install pkg-config
sudo apt-get install autoconf automake libtool make g++ unzip
sudo apt-get install libgflags-dev libgtest-dev
sudo apt-get install clang libc++-dev

如下为我本机gcc版本

 2.安装protobuf

wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-cpp-3.6.1.tar.gztar xzvf protobuf-cpp-3.6.1.tar.gz
cd protobuf-cpp-3.6.1
./autogen.sh
make
sudo make install
sudo ldconfig
//查看版本
protoc --version

3.安装cares库

https://github.com/c-ares/c-ares/releases
tar -zxvf c-ares-cares-1_19_0.tar.gz 
cmake .
make 
sudo make install

3.安装grpc-1.17.x

unzip grpc-1.17.x.zip
cd grpc-1.17.x/
make
sudo make install
cd examples/cpp/
cd helloworld/
make

默认安装位置为/usr/local/

​​​​​​​

 ./greeter_server 

 ./greeter_client 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值