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終于安裝成功!
參考網站: