thrift 编译 -- Ubuntu

本文详细介绍了如何在Ubuntu20.04.3LTS环境下,使用gcc9.4.0和cmake3.16.3来编译Thrift0.13.0,特别强调了只编译C++库,并排除其他语言支持。在完成必要的依赖安装后,通过执行configure脚本和make命令进行编译和安装。最终,通过运行thrift的cpp教程验证了编译的成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境 Ubuntu 20.04.3 LTS

gcc 9.4.0

cmake version 3.16.3

thrift 版本 0.13.0

编译准备

apt-get install build-essential
apt-get install bison flex 
apt-get install libboost-dev libevent-dev 

编译

进入 thrift 源码跟目录

# 屏蔽其他语言,只编译C++的库
./configure --with-pic=PIC --without-as3   --without-c_glib  --without-csharp  --without-java  --without-erlang  --without-nodejs  --without-nodets  --without-lua  --without-python  --without-py3  --without-perl  --without-php  --without-php_extension  --without-dart  --without-ruby  --without-haskell  --without-go  --without-swift  --without-rs  --without-cl  --without-haxe  --without-dotnetcore  --without-d --enable-tests=no CFLAGS=-fPIC CXXFLAGS=-fPIC

make -j8

make install

执行 tutorial

cd tutorial/cpp

 可以看到 rpc 执行成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值