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 Build
Qt 6.11 is out! See what's new in the release blog

Cross Build

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 288 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    Torsten Robitzki
    wrote last edited by
    #1

    Hello,
    I have a project, where I cross compile windows binaries from a docker container which runs linux. Now, I want to add a small GUI that uses qt (makes use of Widgets, Core, and Concurrent). I found a documentation that instructs me to first have a minimum qt host installation using:

    /qt/configure -developer-build -nomake tests
    

    Unfortunately this build creates some warnings that are probably new in gcc 16.1 (-Werror=maybe-uninitialized, -Wsfinae-incomplete=). and as the compiler is configured to treat warnings as errors, the build fails.

    I tried to find other minimal qt host installations like:

    /qt/configure -no-prefix -init-submodules -submodules qttools -release
    

    Which allows me later, to build the cross build qt library:

    cmake -S .. -B . \
            -DCMAKE_TOOLCHAIN_FILE=/toolchain-mingw64.cmake \
            -DQT_HOST_PATH=/QtHostBuild/ \
            -DQT_HOST_PATH_CMAKE_DIR=/QtHostBuild/qtbase/ \
            -DQT_BUILD_SUBMODULES=qtbase \
            -G Ninja
    cmake --build . --parallel
    cmake --install .
    

    But this also fails later, when I try to build my little project against Qt:

    find_package(Qt6 REQUIRED COMPONENTS Widgets Concurrent CONFIG)
    

    Results in `Qt6WidgetsToolsConfig.cmake´ not being found, when dependencies of Qt6Widgets are resolved.

    What are submodules and which submodules do I need to specify in the build, to have access to the components Widgets and Concurrent?

    TIA
    Torsten

    Version used: 6.11.1
    compiler gcc 16.1.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Torsten Robitzki
      wrote last edited by
      #2

      Problem solved, I had to (of cause) tell the build, that the host tools are outside of the scope of the build, by setting QT_HOST_PATH.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #3

        Hi and welcome to devnet,

        Glad you found out and thanks for sharing.

        One thing, don't use the -developer-build unless you plan to hack on Qt itself.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Torsten Robitzki
          wrote last edited by
          #4

          According to the official documentation, I should use it for cross builds: https://doc.qt.io/qt-6/cross-compiling-qt.html

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote last edited by
            #5

            Right ! Sorry, I had your host and target build mixed.

            For other readers, there's also this important note about the minimal host build suggested there:

            This build won't be suitable for developing Qt programs for your host platform, but it will contain the tools necessary to cross-build Qt.
            

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

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