thrift 编译 -- Ubuntu

环境 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 执行成功

猜你喜欢

转载自blog.csdn.net/wjmasd/article/details/131077104