1

我已遵循 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

4

2 回答 2

1

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

rpm -qa | grep qt-devel

如果你发现qt-devel安装的版本低于4.6,请执行命令删除这个包

rpm -qa | grep qt-devel | xargs rpm -e

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

于 2014-07-30T02:10:19.357 回答
0

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

sudo yum install qt4-devel
于 2013-08-13T20:47:53.070 回答