Build errors in cross compile Qt for embedded linux



  • I always get below mentioned errors in qtbase and qtwayland when I cross compile code for embedded linux
    Errors are mainly in below two categories,

    1. Related to header file include missing:
      ../../include/QtCore/../../src/corelib/io/qtextstream.h:46:2: error: #error qtextstream.h must be included before any header file that defines Status

    2. Related double defined types like Bool, KeyPress, KeyRelease, FontChange, CursorShape etc.
      /home/rbhagwat/sources/temp/linux/include/X11/Xlib.h:86:14: error: expected identifier before 'int'
      #define Bool int

    full error log of qtbase is here


  • Lifetime Qt Champion

    Hi,

    Which version of Qt are you cross-compiling ?
    For what platform/board ?
    What options did you pass to configure ?



  • I've same issue with multiple Qt versions like 5.4.2, dev, Qt 5.6.0.
    I'm building it for tegra platform

    ./configure -platform linux-g++ -xplatform linux-tegra-g++ -pkg-config -no-directfb -no-linuxfb -eglfs -system-xcb -cups -nis -no-pch -largefile -accessibility -opengl -glib -icu -dbus -evdev -no-rpath -release -verbose -opensource -confirm-license -sysroot "$SYSROOT_DIR" -extprefix "$QtInstallDir"


  • Lifetime Qt Champion

    I may be wrong but -system-xcb looks suspicious for a cross-compiling configuration. Do you have all these libs available for your target ?



  • Yes, I've all deps/libs in my sysroot, I'm able to cross compile Qt by resolving build errors. Problem is I need to create patches of fixing build issues and maintain it per Qt version.
    I'm expecting, Qt should be built w/o any build errors.



  • I've to create patch like this in order to fix build issues in qtbase


  • Lifetime Qt Champion

    It should yes, that's why I'm thinking there something funky going one. Did you get the sources from git ?



  • Yes, I'm using source from git. Am I doing something wrong here?


  • Lifetime Qt Champion

    No no, it was just to know where you got the sources from.

    What distribution do you have on your sysroot ?



  • x11proto-kb-dev
    x11proto-core-dev
    x11proto-render-dev
    libpcre3-dev
    libxcb-render-util0-dev
    libxau-dev
    libxdmcp-dev
    libpthread-stubs0-dev
    libicu-dev
    libxcb-util0-dev
    libdbus-1-dev
    libxcb-icccm4-dev
    libxcb-image0-dev
    libxcb-keysyms1-dev
    libxext-dev
    libxrender-dev
    libx11-dev
    libx11-xcb-dev
    libexpat1-dev
    libxcb-randr0-dev
    libxcb-render0-dev
    libxcb-shape0-dev
    libxcb-shm0-dev
    libxcb-xfixes0-dev
    libfreetype6-dev
    libglib2.0-dev
    libfontconfig1-dev
    libxcb1-dev
    liborc-0.4-dev
    libxrandr-dev
    libxv-dev
    libasound2-dev
    libgstreamer1.0-dev
    libgstreamer-plugins-base1.0-dev
    libgstreamer-plugins-bad1.0-dev
    libgstreamer-plugins-good1.0-dev
    libxml2-dev
    libjpeg8-dev
    libjpeg-turbo8-dev
    libc6-dev
    libxkbcommon-dev
    libffi-dev
    libgettextpo-dev
    gettext
    libogg-dev
    libvorbis0a
    libvorbisenc2
    libvorbis-dev
    libvorbisfile3
    libstdc++-4.8-dev
    libxcb-xkb1
    libxkbcommon-x11-dev
    libevdev-dev
    xserver-xorg-input-evdev-dev
    libcups2-dev
    nis
    libxcb-sync-dev
    libudev-dev
    libcurl4-openssl-dev
    openssl
    libxcb-xkb-dev
    libpulse-dev
    libcap-dev
    gperf
    libgconf2-dev
    libgcrypt11-dev
    libgnome-keyring-dev
    libnss3-dev
    libpci-dev
    libxtst-dev
    python-gtk2-dev
    libbz2-dev
    libdrm-dev
    libssl-dev
    libxcursor-dev
    libxcomposite-dev
    libxdamage-dev
    libxslt1-dev
    libgeoclue-dev
    libgypsy-dev
    libjasper-dev
    libmng-dev
    libtiff5-dev
    libwebp-dev
    libxcb-xinerama0-dev


  • Lifetime Qt Champion

    But what Linux distribution are you using for your target sysroot ?



  • Ubuntu 15.04


  • Lifetime Qt Champion

    Ubuntu on the target and as sysroot ?



  • Ubuntu 15.04 is on target. I created sysroot by downloading arm 64 bit deb packages to resolve all Qt dependencies on host.


  • Lifetime Qt Champion

    One possibility is to add the QTextStream include where that error appears.

    As for the X11 related errors, try moving the X11 includes after the Qt includes.



  • My intention behind starting this discussion is to avoid resolving build errors when I sync up or switch to new Qt version at my side. As I mentioned I've already resolved build errors and created patches for some Qt versions. But if those errors are fixed there itself as these are genuine build errors then developer do not have to resolve these errors for linux embedded platforms.


  • Lifetime Qt Champion

    Did you submit your patches for inclusion in Qt ?


Log in to reply
 

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