Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cross compile QT with xcb, Feature 'xkbcommon' was enabled, but the pre-condition 'libs.xkbcommon' failed
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved General and Desktop
xcbcross compilearm
6 Posts 3 Posters 4.7k Views
  • 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 Offline
    S Offline
    SanZ
    wrote on 24 Aug 2021, 01:07 last edited by SanZ
    #1

    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
    1
    • S SanZ
      24 Aug 2021, 05:48

      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?

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 24 Aug 2021, 06:48 last edited by
      #5

      @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 24 Aug 2021, 14:36
      2
      • C Offline
        C Offline
        ChrisW67
        wrote on 24 Aug 2021, 05:20 last edited by
        #2

        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
        0
        • S Offline
          S Offline
          SanZ
          wrote on 24 Aug 2021, 05:35 last edited by
          #3

          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
          0
          • S Offline
            S Offline
            SanZ
            wrote on 24 Aug 2021, 05:48 last edited by
            #4

            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?

            J 1 Reply Last reply 24 Aug 2021, 06:48
            0
            • S SanZ
              24 Aug 2021, 05:48

              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?

              J Offline
              J Offline
              JKSH
              Moderators
              wrote on 24 Aug 2021, 06:48 last edited by
              #5

              @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 24 Aug 2021, 14:36
              2
              • J JKSH
                24 Aug 2021, 06:48

                @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.

                S Offline
                S Offline
                SanZ
                wrote on 24 Aug 2021, 14:36 last edited by
                #6

                @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
                1

                1/6

                24 Aug 2021, 01:07

                • Login

                • Login or register to search.
                1 out of 6
                • First post
                  1/6
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved