1

QtSDK x86 GCCとqmakeを使用してパッケージ(maliit)をQtCreator内で正常にコンパイルできます。現在、ARM用のパッケージをクロスコンパイルしようとしています。私の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内からヘッダーをたどることができ、パブリックの下に正しい定義があります。

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

何が間違っている可能性がありますか?私は他のかなりの数のプロジェクトでクロスコンパイルされたライブラリを使用しましたが、それらのプロジェクトでは正常に機能しています。'fromString'静的メソッドを見つけることができなかったのはなぜですか?

4

1 に答える 1

2

Qt configureコマンドのオプションの1つは、マクロの定義を引き起こすことです。これにより、クラスの一般的な定義が空のクラスQT_NO_SHORTCUTに置き換えられます。QKeySequence

于 2012-09-19T01:18:40.457 に答える