如果在thrift-0.13.0目录中直接make编译,会遇到以下问题:
make[3]: Entering directory `/home/openplat/develop/thrift-0.13.0/compiler/cpp/src'
/bin/sh ../../../ylwrap thrift/thrifty.yy y.tab.c thrift/thrifty.cc y.tab.h `echo thrift/thrifty.cc | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output thrift/thrifty.output -- byacc -d
byacc: e - line 1 of "/home/openplat/develop/thrift-0.13.0/compiler/cpp/src/thrift/thrifty.yy", syntax error
%code requires {
^
make[3]: *** [thrift/thrifty.cc] Error 1
make[3]: Leaving directory `/home/openplat/develop/thrift-0.13.0/compiler/cpp/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/openplat/develop/thrift-0.13.0/compiler/cpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/openplat/develop/thrift-0.13.0'
解决方案:
文件目录改名为thrift_0.13。