Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to build Qt X11 for Angstrom, need help



  • Hello.
    I have to build my app for Angstrom linux (http://www.angstrom-distribution.org/) running on an arm platform.

    I have managed to successfully build Qt embedded following this guide: http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html
    However, I need to use Qt X11 as I need my application to work within X.
    I have downloaded Angstrom distribution from http://narcissus.angstrom-distribution.org/ and tried to compile Qt. At first, I tried to use SDK that also came from narcissus, but even ./configure gave me error about being unable to find ld-linux.so.3, so I reverted to using toolchain downloaded from here: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2.
    Straighforward approach led me to the following error while trying to configure:
    "Basic XLib functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11"

    After that I used scratchbox2 as detailed in this guide: http://labs.qt.nokia.com/2009/09/10/cross-compiling-qtx11/

    Configure script worked successfully, but make stopped with the following error:
    @In file included from bridge/npruntime_internal.h:28,
    from plugins/PluginStream.h:38,
    from plugins/PluginView.h:47,
    from bindings/js/ScriptControllerQt.cpp:41:
    bridge/npapi.h:93:22: error: X11/Xlib.h: No such file or directory
    bridge/npapi.h:94:23: error: X11/Xutil.h: No such file or directory
    ....
    make[2]: *** [.obj/release-static/ScriptController.o] Error 1
    make[2]: *** [.obj/release-static/PageScriptDebugServer.o] Error 1
    make[1]: *** [sub-WebCore-make_default-ordered] Error 2
    make: *** [sub-webkit-make_default-ordered] Error 2
    @

    I've tried different approaches around this error, but failed.
    At the moment I stopped using scratchbox2 and tried to use only the functions of qmake.

    So, my qmake.conf looks like this:

    @

    qmake configuration for linux-g++

    MAKEFILE_GENERATOR = UNIX
    TARGET_PLATFORM = unix
    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    QT += core gui
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    SYSROOT=/home/user/Downloads/2
    GCC_PREFIX=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/
    #/opt/dev/QtSDK/Maemo/4.6.2/toolchains/arm-2007q3-51sb6-gdb71-arm-none-linux-gnueabi_linux_x86_64/bin/arm-none-linux-gnueabi

    /opt/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi

    #/opt/toolchains/arm-2011.03-41-arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi

    modifications to g++.conf

    QMAKE_CC = $${GCC_PREFIX}gcc --sysroot=$${SYSROOT}
    QMAKE_CXX = $${GCC_PREFIX}g++ --sysroot=$${SYSROOT}
    QMAKE_LINK = $${GCC_PREFIX}g++ --sysroot=$${SYSROOT}
    QMAKE_LINK_SHLIB = $${GCC_PREFIX}g++ --sysroot=$${SYSROOT}

    modifications to linux.conf

    QMAKE_AR = $${GCC_PREFIX}ar cqs
    QMAKE_OBJCOPY = $${GCC_PREFIX}objcopy
    QMAKE_STRIP = $${GCC_PREFIX}strip

    QMAKE_INCDIR_X11 =
    QMAKE_LIBDIR_X11 =
    QMAKE_INCDIR_OPENGL =
    QMAKE_LIBDIR_OPENGL =

    QMAKE_INCDIR += $${SYSROOT}/usr/include
    QMAKE_LIBDIR += $${SYSROOT}/usr/lib

    We still need to generate debug symbols in release mode to put into the *-dbg packages:

    QMAKE_CFLAGS_RELEASE += -Os -mfloat-abi=softfp -mfpu=neon -march=armv7-a -mcpu=cortex-a8
    QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE

    Work round PowerVR SGX 1.3 driver bug with glScissor & FBOs:

    DEFINES += QT_GL_NO_SCISSOR_TEST

    Work round SGX 1.4 driver bug (text corrupted), modify glyph cache width:

    DEFINES += QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH=1024

    load(qt_config)
    @

    My configure parameters are:

    @ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -arch arm -little-endian -xplatform linux-omap3430-g++ -no-webkit --verbose@

    The result is still the same:
    @error: X11/Xlib.h: No such file or directory@
    So, I don't even know what to try next. Could someone please help me?



  • I've solved my problem. It turned out to be a very weird one.
    As I have written above, I have tried different configurations for Qt. For some reason at least one makefile generated by configure (Makefile.WebKit) wasn't overwritten. As a result, that makefile did not contain includes like $${SYSROOT}/usr/include. So, make did not know where to look for X11.
    Really weird. Why wasn't it overwritten? I have reconfigured Qt really quite a lot of times with these includes.
    Unpacking qt distro to another directory and running configure and make from there solved the problem.


Log in to reply