1

我可以在 QtCreator 中使用 QtSDK x86 GCC 和 qmake 编译我的包 (maliit)。我现在正在尝试为 ARM 交叉编译 pacakge。我的 Qmake 和 Qt 库是使用 Buildroot 使用以下配置构建的:

cd /home/user/project/output/buildroot/build/qt-4.8.1; PKG_CONFIG_SYSROOT_DIR="/home/user/project/output/buildroot/host/usr/arm-unknown-linux-gnueabi/sysroot" PKG_CONFIG="/home/user/project/output/buildroot/host/usr/bin/pkg-config" PKG_CONFIG_PATH="/home/user/project/output/buildroot/host/usr/arm-unknown-linux-gnueabi/sysroot/usr/lib/pkgconfig:" MAKEFLAGS="w --  -j1" ./configure -silent -force-pkg-config -separate-debug-info -xplatform qws/linux-arm-gnueabi-g++- -opensource -confirm-license -largefile -no-qt3support -nomake examples -nomake demos -depths 16,32 -qt-gfx-linuxfb -no-gfx-transformed -no-gfx-qvfb -qt-gfx-vnc -no-gfx-multiscreen -no-gfx-directfb -no-mouse-pc -no-mouse-linuxtp -qt-mouse-linuxinput -qt-mouse-tslib -no-mouse-qvfb -no-kbd-tty -qt-kbd-linuxinput -no-kbd-qvfb -debug -shared -little-endian -embedded arm -no-gif -no-libmng -system-zlib -qt-libjpeg -qt-libpng -no-libtiff -qt-freetype -dbus -qdbus -no-openssl -no-sql-sqlite -no-xmlpatterns -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -svg -no-webkit -no-script -no-scripttools -no-javascript-jit -no-stl -no-declarative -glib -no-gfx-qnx -no-kbd-qnx -no-mouse-qnx -no-xinerama -no-cups -no-nis -no-accessibility -prefix /usr -plugindir /usr/lib/qt/plugins -hostprefix /home/user/project/output/buildroot/host/usr/arm-unknown-linux-gnueabi/sysroot/usr -fast -no-rpath

当我尝试在 QtCreator 中交叉编译包时,它会运行到一半,然后在以下函数的 Q_EMIT 行出错:

void GlibDBusIMServerProxy::onInvokeAction(const QString &action,
                                           const QString &sequence)
{
    Q_EMIT invokeAction(action, QKeySequence::fromString(sequence));
}

该文件肯定包含标题:

#include <QKeySequence>

这是整个构建错误:

glibdbusimserverproxy.cpp: In member function 'void GlibDBusIMServerProxy::onInvokeAction(const QString&, const QString&)':
glibdbusimserverproxy.cpp:230:33: error: 'fromString' is not a member of 'QKeySequence'
make[1]: Leaving directory `/home/user/Desktop/maliit-framework/connection'
make[1]: *** [.obj/glibdbusimserverproxy.o] Error 1
make: Leaving directory `/home/user/Desktop/maliit-framework'
make: *** [sub-connection-make_default-ordered] Error 2
12:51:08: The process "/usr/bin/make" exited with code 2.
Error while building project maliit-framework (target: Desktop)
When executing build step 'Make'

我可以从 IDE 中跟踪标题,并且在 Public 下有正确的定义:

static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText);

有什么问题?我已经在很多其他项目中使用了交叉编译的库,并且对这些项目运行良好。它怎么找不到'fromString'静态方法?

4

1 回答 1

2

Qt 配置命令的选项之一是定义QT_NO_SHORTCUT宏,它用QKeySequence空类替换类的一般定义。

于 2012-09-19T01:18:40.457 回答