Configure fails for Qt5 for ARM based board



  • Hi, I want to build Qt5.3.1 for an ARM based device. The cross compiler is as following:
    Target: armv5tl-montavista-linux-gnueabi
    gcc version 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)

    I cloned the Qt5/stable, init-repository, and run confiure with the following flags:

    ./configure -xplatform linux-arm-gnueabi-g++
    -device-option CROSS_COMPILE=/opt/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin
    -sysroot /opt/montavista/pro/devkit/arm/v5t_le
    -prefix /usr/local/qt5elinux
    -extprefix /usr/local/qt5elinux
    -debug -no-c++11 -static -no-gtkstyle -no-openssl -confirm-license -opensource -verbose

    I got the following error:

    g++ -c -o project.o -pipe -ffunction-sections -g -g -I/home/sxu/src/qt5/qtbase/qmake -I/home/sxu/src/qt5/qtbase/qmake/library -I/home/sxu/src/qt5/qtbase/qmake/generators -I/home/sxu/src/qt5/qtbase/qmake/generators/unix -I/home/sxu/src/qt5/qtbase/qmake/generators/win32 -I/home/sxu/src/qt5/qtbase/qmake/generators/mac -I/home/sxu/src/qt5/qtbase/qmake/generators/integrity -I/home/sxu/src/qt5/qtbase/include -I/home/sxu/src/qt5/qtbase/include/QtCore -I/home/sxu/src/qt5/qtbase/include/QtCore/5.3.1 -I/home/sxu/src/qt5/qtbase/include/QtCore/5.3.1/QtCore -I/home/sxu/src/qt5/qtbase/src/corelib/global -DHAVE_QCONFIG_CPP -I/home/sxu/src/qt5/qtbase/mkspecs/linux-g++ -I/home/sxu/src/qt5/qtbase/tools/shared -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY /home/sxu/src/qt5/qtbase/qmake/project.cpp
    In file included from /home/sxu/src/qt5/qtbase/include/QtCore/qglobal.h:1,
    from /home/sxu/src/qt5/qtbase/qmake/library/qmake_global.h:45,
    from /home/sxu/src/qt5/qtbase/qmake/library/qmakeparser.h:45,
    from /home/sxu/src/qt5/qtbase/qmake/library/qmakeevaluator.h:49,
    from /home/sxu/src/qt5/qtbase/qmake/project.h:45,
    from /home/sxu/src/qt5/qtbase/qmake/project.cpp:42:
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:443: error: ‘QT_POINTER_SIZE’ was not declared in this scope
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:443: error: template argument 1 is invalid
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:443: error: expected initializer before ‘qregisterint’
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:444: error: ‘QT_POINTER_SIZE’ was not declared in this scope
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:444: error: template argument 1 is invalid
    /home/sxu/src/qt5/qtbase/include/QtCore/../../src/corelib/global/qglobal.h:444: error: expected initializer before ‘qregisteruint’
    make: *** [project.o] Error 1

    I also exported two env settings before run the configure:
    export QMAKESPEC=
    export PATH=/opt/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linux-gnueabi/bin:$PATH

    Can any one who has the expertise provide some advice to fix the problem? Much appreciated.



  • Update, even using the flags from the example in http://qt-project.org/wiki/Building_Qt_5_from_Git

    ./configure -developer-build -opensource -nomake examples -nomake tests

    I still get the same error.


  • Lifetime Qt Champion

    Hi,

    Don't try to cross-compile a developer build. Developer builds are meant for those developing Qt.

    Have a look at "this article":http://blog.qt.digia.com/blog/2012/04/13/cross-compiling-qt-for-the-masses/ and the related "wiki entry":http://qt-project.org/wiki/Category:Devices



  • Hi SGaist,

    Thank you very much for the quick response.

    I did not use -developer-build in my initial configure flags. The one with this flag was to show the example did not work. The flags I used are in my first post.

    I did not specify -device in configure flags since none arm device is the same one as mine. Do I need to create customized device files for my build (as for Qt4'smkspec)?

    Thanks.



  • Hi SGaist,

    I think it could be caused by the cross compiler or some include directory missing.

    I just did a quick test in a new terminal:

    ./congure -opensource -nomake example -nomake tests -verbose

    It passed the fail point. I noticed this time conger using my host system's compiler gcc-4.8. The cross compiler is gcc 4.2.

    What directories should I preset or export? Does this related to my sysroot flag setting?

    Thanks.


  • Lifetime Qt Champion

    You should rather do out of source builds, so if something goes wrong you can just delete the whole thing and start over without having to clean the sources.

    If you (re)configured several times for compilation/cross-compilation without cleaning in between then you probably have a messed up build in there.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.