Qt 5.12.2 Raspberry Pi X11



  • Hi all,

    I recently cross-compiled Qt 5.12.2 to my Raspberry Pi 3 B+ from a Linux Mint machine, but I've learned that I don't want to use EGLFS. Currently, I can only run my application using EGLFS as the platform, but I want to run my application as a standard X11 application. I've tried using xcb as a platform, but my Raspberry Pi cannot find this platform. In addition, when I try to run the configure script with options -no-eglfs -qt-xcb -xcb, I get the following error:
    ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed.

    This is the full command I'm using:
    ./configure -release -no-eglfs -qt-xcb -xcb -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm

    I've been searching forums and tutorials and cannot seem to figure out how to accomplish my goal, so I'd greatly appreciate any help I can get!


  • Moderators

    @Lashc said in Qt 5.12.2 Raspberry Pi X11:

    -no-eglfs -qt-xcb -xcb

    No need to put it here, XCB is built by default even if you don't specify it.

    ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed.

    You need to install all missing dependencies. These should do it:

    sudo apt-get build-dep qt4-x11
    sudo apt-get build-dep libqt5gui5
    sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
    


  • I've installed those dependencies, updated my sysroot, and recompiled Qt, but I still cannot run my application using XCB. The configure script continues to produce these lines:

    X11 specific:
        XLib ................................. no
        XCB Xlib ............................. no
        EGL on X11 ........................... no
    

    And just to be clear, I'm compiling Qt on my Linux machine and then transferring the resulting files to my Raspberry Pi. What else can I try?


  • Moderators

    I've checked my build scripts and came up with a few more dependencies. Now, these are probably too many, but maybe they will help:

    sudo apt-get build-dep qt5-default
    sudo apt-get install libiconv-hook-dev libinput-dev libts-dev bluez libbluetooth-dev libgstreamer1.0-dev libegl1-mesa
    sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libatspi2.0-dev libdbus-1-dev
    

  • Qt Champions 2018

    @Lashc To add to @sierdzio : you can add -v parameter to configure - you will then see what exactly is missing (headers/libs).



  • @sierdzio I've installed those dependencies and still can't run the application under X11. @jsulm When I run configure with that option, the only thing that I could find that may be a problem is this:

    Trying source 0 (type pkgConfig) of library xkbcommon ...
    + PKG_CONFIG_SYSROOT_DIR=/home/christian/raspi/sysroot PKG_CONFIG_LIBDIR=/home/christian/raspi/sysroot/usr/lib/pkgconfig:/home/christian/raspi/sysroot/usr/share/pkgconfig:/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --exists --silence-errors xkbcommon '>=' 0.5.0
    + PKG_CONFIG_SYSROOT_DIR=/home/christian/raspi/sysroot PKG_CONFIG_LIBDIR=/home/christian/raspi/sysroot/usr/lib/pkgconfig:/home/christian/raspi/sysroot/usr/share/pkgconfig:/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --modversion xkbcommon '>=' 0.5.0
    > 0.7.1
    + PKG_CONFIG_SYSROOT_DIR=/home/christian/raspi/sysroot PKG_CONFIG_LIBDIR=/home/christian/raspi/sysroot/usr/lib/pkgconfig:/home/christian/raspi/sysroot/usr/share/pkgconfig:/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --libs-only-L xkbcommon '>=' 0.5.0
    > -L/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf
    + PKG_CONFIG_SYSROOT_DIR=/home/christian/raspi/sysroot PKG_CONFIG_LIBDIR=/home/christian/raspi/sysroot/usr/lib/pkgconfig:/home/christian/raspi/sysroot/usr/share/pkgconfig:/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --libs-only-l xkbcommon '>=' 0.5.0
    > -lxkbcommon
    + PKG_CONFIG_SYSROOT_DIR=/home/christian/raspi/sysroot PKG_CONFIG_LIBDIR=/home/christian/raspi/sysroot/usr/lib/pkgconfig:/home/christian/raspi/sysroot/usr/share/pkgconfig:/home/christian/raspi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /usr/bin/pkg-config --cflags xkbcommon '>=' 0.5.0
    xkbcommon/xkbcommon.h not found in [] and global paths.
      => source produced no result.
    test config.qtbase_gui.libraries.xkbcommon FAILED
    

    This sticks out to me because running configure with the -qt-xcb option gives me "ERROR: Feature 'xcb' was enabled, but the pre-condition 'features.thread && features.xkbcommon && libs.xcb' failed." If I run configure without this option, that error does not appear. Also, the libqxcb.so file is missing from /plugins/platforms in my Qt directory on the Raspberry Pi.


  • Moderators

    @sierdzio said in Qt 5.12.2 Raspberry Pi X11:

    sudo apt-get install "^libxcb.*"

    This line should have installed libxcb. Weird! Last time I tried, I think I was compiling Qt 5.10.1. Try with that version perhaps? More importantly, though - make sure you update your sysroot after installing all these new dependencies.



  • @sierdzio @jsulm Compiling Qt 5.10.1 instead did the trick! I don't think there's anything I'll miss from Qt 5.12. Thank you all so much!


  • Lifetime Qt Champion

    Hi,

    Since Qt 5.12.1, xkbcommon is not provided anymore as all older platforms supported now provides that dependency.



  • @SGaist I checked to see if I have any xkbcommon packages installed on my Raspberry Pi, and I discovered the following ones:

    libxkbcommon-dev, libxkbcommon-x11-0, libxkbcommon-x11-dev, and libxkbcommon0
    

    I tried to compile Qt 5.12.2 again, but I still received errors about xkbcommon and xcb.


  • Lifetime Qt Champion

    Which version are they ?



  • This topic has garnered my interest, and I'll follow it from now. Getting to know very interesting revelations by the way, Samuel.



  • @SGaist Here's a list of the packages and their respective versions:
    libxkbcommon-dev: 0.7.1-2~deb9u1
    libxkbcommon-x11-0: 0.7.1-2~deb9u1
    libxkbcommon-x11-dev: 0.7.1-2~deb9u1
    libxkbcommon0: 0.7.1-2~deb9u1



  • This is due to changes in Qt's configure system in 5.12+. Namely, commits like this one: https://github.com/qt/qtbase/commit/e80bf655e922e9864f8843b5e7bbb47019a6d95a

    Anywhere there once was "include": "suchandsuch" inside a test that was changed to "headers": "suchandsuch" outside the test fails now when cross-compiling for Raspbian.

    I'm in the process of trying to find and revert them all but have gotten stuck on the somewhat more complicated Xlib detection:

    "xlib": {
    	"label": "XLib",
    	"test": {
    		"main": [
    			"Display *d = XOpenDisplay(NULL);",
    			"XCloseDisplay(d);"
    		]
    	},
    	"headers": "X11/Xlib.h",
    	"sources": [
    		{ "type": "makeSpec", "spec": "X11" }
    	]
    },
    

    It's that { "type": "makeSpec", "spec": "X11" } line that is failing. I'm not yet sure how to modify that one. Once I figure this out I'll open a bug and see if we can boil it down to a root cause. I'm sure the way I'm adjusting the configure.json isn't quite correct.

    /ranton How changes that can break this on this level made their debut in an LTS is beyond me. /rantoff



  • As I suspected, I was going down the wrong path. The issue is QTBUG-74326, and resolved in this patch which is scheduled for Qt 5.12.3.

    It doesn't seem to be a perfect fix as it corrects the system library detection for me but breaks linking QtWebEngine.



  • @hlmjr said in Qt 5.12.2 Raspberry Pi X11:

    As I suspected, I was going down the wrong path. The issue is QTBUG-74326, and resolved in this patch which is scheduled for Qt 5.12.3.

    It doesn't seem to be a perfect fix as it corrects the system library detection for me but breaks linking QtWebEngine.

    I tried to apply the patch, however it changed nothing. Can you explain how you did it? There's no explanation online on how to apply such patches manually, only via git when having previously cloned the git repo. I wanted to apply it to the current source release (qt-everywhere-src-5.12.2), though.

    I myself am currently trying to cross-compile Qt 5.12.2 for Raspberry Pi 3 B+.
    Weirdly enough I have to configure with -device linux-rasp-pi-g++ to get EGLFS to work, might that be the problem?



  • @Antiheld True, it is difficult to get a patch from those changesets they way they're displayed in gerrit. I created one myself you can obtain from https://www.sky-meyg.com/downloads/rpi-qt5.12-configure.patch. Apply it with patch -p0 < rpi-qt5.12-configure.patch in your Qt source directory.



  • @hlmjr Thank you for your quick answer!
    Weirdly enough it doesn't change anything for me. Maybe I'm doing something wrong.
    For now EGLFS will have to suffice, I guess.
    Thank you anyway!


Log in to reply
 

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