Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Solved Cross compile QT with xcb, Feature 'xkbcommon' was enabled, but the pre-condition 'libs.xkbcommon' failed

    General and Desktop
    xcb cross compile arm
    3
    6
    1286
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SanZ last edited by SanZ

      Hi,

      I am trying to cross compile QT on Ubuntu 20.04, targeting an ARM chip, the toolchain is a OpenWRT-based one.

      The build was fine with -no-xcb configure option. However when I try to enable xcb, I get the errors:

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

      I see that most people get the second error, but not a lot of people get the first one, and fewer in cross compiling. I have installed
      "sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev"
      But it did not help, I guess it's because I'm cross compiling.

      In my verbose log I see:
      /path/to/pkg-config --exists --silence-errors xkbcommon '>=' 0.5.0
      pkg-config did not find package.
      => source produced no result.
      Trying source 1 (type inline) of library xkbcommon ...
      None of [libxkbcommon.so libxkbcommon.a] found in [] and global paths.
      => source produced no result.

      I also noticed that the libxkbcommon has been removed from qtbase source tree. So my question to start is: would I have to build libxkbcommon myself with my toolchain? Because I assume the ones I can find under /usr/lib won't do as they're for either i386 or x86_64, not ARM.

      1 Reply Last reply Reply Quote 1
      • JKSH
        JKSH Moderators @SanZ last edited by

        @SanZ said in Cross compile QT with xcb, Feature 'xkbcommon' was enabled, but the pre-condition 'libs.xkbcommon' failed:

        Also, I have a bunch of -skip options in my configure, maybe one of them stopped xcb from being configured/built?

        I don't think so. XCB support only depends on the system's XCB and other graphical libraries. It doesn't depend on other Qt modules (whereas -skip only disables Qt modules)

        Check the output of your configuration script (I believe you'll have a file called configure.summary) -- it should list what components are found or not found.

        It seems that -qt-xcb option was removed from 5.12.1 onward?

        Yes, it was removed in recent versions of Qt, for 2 reasons:

        • Security: It is safer for users to link to the latest XCB libraries than to use an old, bundled version
        • Maintenance: It takes up resources for Qt to keep updating and patching its own copy of XCB

        As @ChrisW67 said, use your toolchain to cross-compile XCB first, then cross-compile Qt.

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        S 1 Reply Last reply Reply Quote 2
        • C
          ChrisW67 last edited by

          You will need the library suitable for linking in your target environment, and you will probably have to build it (and any dependencies) yourself.

          1 Reply Last reply Reply Quote 0
          • S
            SanZ last edited by

            Thank you Chris. That's what I was afraid of... But it doesn't make sense to me that QT would make it so difficult for people to cross compile this xcb platform plugin as I read somewhere else on this forum that the cross compile was fine with QT5.10.1 ...

            1 Reply Last reply Reply Quote 0
            • S
              SanZ last edited by

              Some additional notes after a bit more search...

              It seems that -qt-xcb option was removed from 5.12.1 onward? I am using 5.12.11, and when I try to remove -qt-xcb, the build is OK but does not generate libqxcb.so which is what I needed in the first place.

              Also, I have a bunch of -skip options in my configure, maybe one of them stopped xcb from being configured/built? Is there a documentation somewhere on what -skip or -no-feature options would disable what components?

              JKSH 1 Reply Last reply Reply Quote 0
              • JKSH
                JKSH Moderators @SanZ last edited by

                @SanZ said in Cross compile QT with xcb, Feature 'xkbcommon' was enabled, but the pre-condition 'libs.xkbcommon' failed:

                Also, I have a bunch of -skip options in my configure, maybe one of them stopped xcb from being configured/built?

                I don't think so. XCB support only depends on the system's XCB and other graphical libraries. It doesn't depend on other Qt modules (whereas -skip only disables Qt modules)

                Check the output of your configuration script (I believe you'll have a file called configure.summary) -- it should list what components are found or not found.

                It seems that -qt-xcb option was removed from 5.12.1 onward?

                Yes, it was removed in recent versions of Qt, for 2 reasons:

                • Security: It is safer for users to link to the latest XCB libraries than to use an old, bundled version
                • Maintenance: It takes up resources for Qt to keep updating and patching its own copy of XCB

                As @ChrisW67 said, use your toolchain to cross-compile XCB first, then cross-compile Qt.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                S 1 Reply Last reply Reply Quote 2
                • S
                  SanZ @JKSH last edited by

                  @JKSH Thank you. I had hoped that there was a simpler way I didn't know about, maybe twerk some configure options and it'll enable and build xcb... But if there's not there's not, I'll just cross compile xcb as you and Christ both suggested.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post