thrift-0.9.0安装
http://wiki.apache.org/thrift/ThriftInstallation
Basic requirements
A relatively POSIX-compliant *NIX system
Cygwin or MinGW can be used on Windows
g++ 3.3.5+
boost 1.33.1+ (1.34.0 for building all tests)
Runtime libraries for lex and yacc might be needed for the compiler.
一、安装依赖
yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel
wget http://archive.apache.org/dist/thrift/0.9.0/thrift-0.9.0.tar.gztar zxvf thrift-0.9.0cd thrift-0.9.0
./bootstrap.sh./configuremakemake install
$ thrift -versionThrift version 0.9.0
<dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.9.0</version></dependency>
cd ./contrib/fb303/./bootstrap.sh ./configuremakemake install
cd ./thrift-0.9.0/tutorialthrift -r -gen cpp tutorial.thrift // -r对其中include的文件也生成服务代码 -gen是生成服务代码的语言cd cppmake