无法在Centos6.4上编译thrift-0.9.0

时间:2013-08-13 20:43:17

标签: qt qt4 thrift

我已经按照Apache thrift wiki中提到的所有说明进行操作。我下载了thrift源代码,然后安装了依赖项

sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel

然后跑

./configure

(没有运行bootstrap.sh,因为thrift-0.9.0代码库中没有bootstrap.sh)。最后,我收到了这个错误。知道为什么会这样吗?

libtool: link: ( cd ".libs" && rm -f "libthriftz.la" && ln -s "../libthriftz.la" "libthriftz.la" )
/bin/sh ../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..  -I/usr/include -I./src -I./src/thrift -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtNetwork    -Wall -g -O2 -MT libthriftqt_la-moc_TQTcpServer.lo -MD -MP -MF .deps/libthriftqt_la-moc_TQTcpServer.Tpo -c -o libthriftqt_la-moc_TQTcpServer.lo `test -f 'src/thrift/qt/moc_TQTcpServer.cpp' || echo './'`src/thrift/qt/moc_TQTcpServer.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/include -I./src -I./src/thrift -DQT_SHARED -I/usr/include/QtCore -I/usr/include/QtNetwork -Wall -g -O2 -MT libthriftqt_la-moc_TQTcpServer.lo -MD -MP -MF .deps/libthriftqt_la-moc_TQTcpServer.Tpo -c src/thrift/qt/moc_TQTcpServer.cpp  -fPIC -DPIC -o .libs/libthriftqt_la-moc_TQTcpServer.o
src/thrift/qt/moc_TQTcpServer.cpp:14:2: error: #error "This file was generated using the moc from 4.8.1. It"
src/thrift/qt/moc_TQTcpServer.cpp:15:2: error: #error "cannot be used with the include files from this version of Qt."
src/thrift/qt/moc_TQTcpServer.cpp:16:2: error: #error "(The moc has changed too much.)"
src/thrift/qt/moc_TQTcpServer.cpp:47: error: no 'void apache::thrift::async::TQTcpServer::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)' member function declared in class 'apache::thrift::async::TQTcpServer'
src/thrift/qt/moc_TQTcpServer.cpp:62: error: 'const QMetaObjectExtraData apache::thrift::async::TQTcpServer::staticMetaObjectExtraData' is not a static member of 'class apache::thrift::async::TQTcpServer'
src/thrift/qt/moc_TQTcpServer.cpp:63: error: 'qt_static_metacall' was not declared in this scope
src/thrift/qt/moc_TQTcpServer.cpp:64: error: too many initializers for 'const QMetaObjectExtraData'
src/thrift/qt/moc_TQTcpServer.cpp:68: error: 'staticMetaObjectExtraData' was not declared in this scope
src/thrift/qt/moc_TQTcpServer.cpp:69: error: too many initializers for 'QMetaObject::<anonymous struct>'
src/thrift/qt/moc_TQTcpServer.cpp: In member function 'virtual int apache::thrift::async::TQTcpServer::qt_metacall(QMetaObject::Call, int, void**)':
src/thrift/qt/moc_TQTcpServer.cpp:95: error: 'qt_static_metacall' was not declared in this scope
make[4]: *** [libthriftqt_la-moc_TQTcpServer.lo] Error 1
make[4]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib/cpp'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/rjain/Downloads/thrift-0.9.0'
make: *** [all] Error 2

我从http://www.apache.org/dyn/closer.cgi?path=/thrift/0.9.0/thrift-0.9.0.tar.gz

下载源代码

2 个答案:

答案 0 :(得分:1)

你的qt-devel已经过时了。只需删除qt-devel rpm并重新运行configure脚本,该脚本将跳过此部分。这个对我有用。 首先,通过执行以下命令检查与qt相关的rpms

rpm -qa | grep qt-devel

如果您发现qt-devel的安装版本低于4.6,请执行命令

删除此软件包
rpm -qa | grep qt-devel | xargs rpm -e

如果这样做,将跳过thrift的qt部分。

答案 1 :(得分:0)

您系统上的Qt版本看起来比此程序预期的版本要早。您可以尝试将Qt更新到更高版本吗?

sudo yum install qt4-devel