Cross-compiling Qt-4.8 fails due to undefined interface

  • Hi,

    I'm trying to cross-compile Qt-4.8 for ARM. I have an ARM chroot which contains the Qt-4.8 depedencies. I set the cross-compiler in
    mkspecs/qws/linux-arm-g++ and I run the configure script with the following options:

    @./configure -opensource -arch arm -xplatform qws/linux-arm-g++ -release -openssl -no-cups -no-gtkstyle -no-webkit -nomake examples -nomake demos
    -I$ARMROOT/usr/include -L$ARMROOT/usr/lib -L$ARMROOT/lib
    -lX11 -lxcb -lXau -lXdmcp -lXext
    --prefix=$ARMROOT/usr/local/Trolltech/Qt-4.8.0-arm-cross $*@

    NOTE: ARMROOT is the path of prepared ARM environment (chroot)

    Then I launch the build with make which uses the cross-compiler well but I get the following error during the corelib's compilation:
    @/usr/local/armv7-webkit/usr/local/src/qt/bin/moc -DQT_SHARED -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DELF_INTERPRETER="/lib64/" -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_NO_DEBUG -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-g++ -I. -I../../include -I../../include/QtCore -I.rcc/release-shared -Iglobal -I../../tools/shared -I../3rdparty/zlib -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I.moc/release-shared codecs/qtextcodecplugin.h -o .moc/release-shared/moc_qtextcodecplugin.cpp
    QFSFileEngine::currentPath: stat(".") failed
    QFSFileEngine::currentPath: stat(".") failed
    codecs/qtextcodecplugin.h:73: Error: Undefined interface
    make: *** [.moc/release-shared/moc_qtextcodecplugin.cpp] Error 1@

    I googled for similar problems and I found that the removement of some moc temporary files can solve this:

    Probably it worked for earlier versions of Qt but I haven't found any tmp directory or mocinclude.* files in Qt-4.8 sources.

    One additional thing I tried both the released tarball and the source from the repository.

    Any suggestions? Is there anybody who have met this problem earlier?


  • Peter,

    I am having exactly this problem with 4.8.2.

    Did you ever get a solution?

  • Hi bddb,

    Unfortunately I couldn't solve this problem. Finally I compiled Qt 4.8.2 on a board.
    If you find anything useful please let me know :)

  • The only way I could get it to compile was to patch it:

    I have not gotten the whole of Qt to compile yet, so I haven't run anything and, consequently, don't know what effect this patch has on Qt's behaviour.

    I wonder if the problem is compiler-related. I get a successful compile for my workstation, just running configure and make. It's g++ 4.6.1 on Ubuntu.
    The target compiler (for use with crosstool-ng) is g++4.5.2. However, the docs for Qt don't suggest a particular version.

    Another thing I noticed, is that the include paths are not necessarily the same for a host build versus target build. Specifically, I have noticed that the critical include path


    is usually missing.

    When put together with you comment regarding compilation "on a board", it seems that a bit of work is still required in order to do cross/target builds.

  • It seems like this is related to moc ignoring #includes in the header file.
    I found that I also had this problem when compiling on a 64 bit linux host system.
    When I switched to a 32bit host it disappeared.

Log in to reply