1、下载源码

git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift

2、生成configure scripts

./bootstrap.sh

3、configure

./configure

在configure过程中,提示以下错误:

./configure: line 16656: syntax error near unexpected token `QT,'
./configure: line 16656: `    PKG_CHECK_MODULES(QT, QtCore >= 4.3, QtNetwork >= 4.3, have_qt=yes, have_qt=no)'

解决方法:安装apt-get install pkg-config

4、make

make

第一遇到的错误:command yacc is not found

解决办法:sudo apt-get install flex bison

第二个遇到的错误:./thriftl.cc: No such file or directory

解决办法:放弃使用make,改用cmake

第三个错误:CMake 3.0 or higher is required

解决办法:删除旧的版本apt-get remove cmake

安装新的cmake:

sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
sudo -E apt-get update
apt-get install cmake

最终使用cmake .安装成功

5、make install

make install

至此,thrift终于安装成功!


参考网站:



登陆发表评论