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. meet a problem when attempting to promote imported target "Threads::Threads" to global scope
Qt 6.11 is out! See what's new in the release blog

meet a problem when attempting to promote imported target "Threads::Threads" to global scope

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 2 Posters 2.1k 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.
  • N Offline
    N Offline
    novum
    wrote last edited by
    #1

    I ran into a problem when cross-building Qt 6.4.2 from source by following Cross-Compile_Qt_6_for_Raspberry_Pi.

    the cmake produced the following output.

    CMake Error at qtbase/cmake/QtPublicTargetHelpers.cmake:257 (set_property):
      Attempt to promote imported target "Threads::Threads" to global scope (by
      setting IMPORTED_GLOBAL) which is not built in this directory.
    Call Stack (most recent call first):
      qtbase/cmake/QtFindPackageHelpers.cmake:180 (__qt_internal_promote_target_to_global)
      qtbase/src/corelib/CMakeLists.txt:4 (qt_find_package)
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by
      #9

      Can you try with a more recent version of Qt ?
      While I understand the motivation of staying on certain version, these kind of issue might have already been solved later.

      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
      • N Offline
        N Offline
        novum
        wrote last edited by
        #2

        find_package(Threads) might have been called in another directory first, and that's why promoting imported target "Threads::Threads" to global scope fails here

        1 Reply Last reply
        0
        • N Offline
          N Offline
          novum
          wrote last edited by
          #3

          I got sysroot from latest RPi OS image.

          In the sysroot, the file /usr/lib/aarch64-linux-gnu/cmake/zstd/zstdConfig.cmake has the following code,

          include(CMakeFindDependencyMacro)
          if(ON AND "1")
            find_dependency(Threads)
          endif()
          
          include("${CMAKE_CURRENT_LIST_DIR}/zstdTargets.cmake")
          
          check_required_components("zstd")
          
          1 Reply Last reply
          0
          • N Offline
            N Offline
            novum
            wrote last edited by
            #4

            the host system is Ubuntu 24.04.
            the RPi5 system is Debian Trixie.

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

              Hi,

              Might be a silly question but did you properly use two separate build folders ?
              Also why Qt 6.4.2 rather than a current version ?

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

              N 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi,

                Might be a silly question but did you properly use two separate build folders ?
                Also why Qt 6.4.2 rather than a current version ?

                N Offline
                N Offline
                novum
                wrote last edited by
                #6

                @SGaist yes, I use two separate build folders. It's in the buildhost directory to build Qt for the host machine, and in the buildrpi5 directory for the rpi5.

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

                  You did not answer about the use of an outdated version of 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
                  0
                  • N Offline
                    N Offline
                    novum
                    wrote last edited by
                    #8

                    I migrate my application, originally developed on Ubuntu 24.04, from x86 to the RPi5.
                    I want to use the same Qt version to develop the application for both platforms.

                    I built Qt 6.4.2 from source, as the latest Raspbian ships with Qt 6.8.2.

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

                      Can you try with a more recent version of Qt ?
                      While I understand the motivation of staying on certain version, these kind of issue might have already been solved later.

                      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
                      • N Offline
                        N Offline
                        novum
                        wrote last edited by
                        #10

                        I fixed it by checking the latest source code. : )

                        1 Reply Last reply
                        0
                        • N novum has marked this topic as solved
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote last edited by
                          #11

                          Excellent !

                          Good luck :-)

                          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

                          • Login

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