Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99121

CMakeError due to missing packages on WSL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 6.2.0
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      I am getting below errors while building our project  on a WSL that uses Qt libraries. I have built the static libraries of Linux for Qt 6.2. Now, these libraries are used in our project.

       

      The cmake code has the below find_package statement and target_link_libraries mentioned :

      find_package(Qt6 COMPONENTS Core Quick Gui Qml REQUIRED)
      
      target_link_libraries(*${TargetName}*
              PRIVATE
                  Qt*${QT_VERSION_MAJOR}*::Quick
                  Qt*${QT_VERSION_MAJOR}*::OpenGL
                  Qt*${QT_VERSION_MAJOR}*::Gui
                  Qt*${QT_VERSION_MAJOR}*::Core
             )
      

       

      During cmake cache generation, I get a bunch of errors. I am sure these error are due to some missing packages in the WSL instance.

      I have installed all the packages as mentioned in the below links :

      https://doc.qt.io/qt-6/linux-requirements.html

      https://doc.qt.io/qt-6/linux.html

       

      I still get a bunch of errors. Please find the errors below for reference.

       

      Can you please let me know the packages that are missing or any easy way to find the missing packages that need to be installed ?

       

      Errors:

       

      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithoutPresentation" links to target "XCB::XINPUT"
      
        but the target was not found.  Perhaps a find_package() call is missing for
      
        an IMPORTED target, or an ALIAS target is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithPresentation" links to target
      
        "Qt6::EglFsKmsGbmSupportPrivate" but the target was not found.  Perhaps a
      
        find_package() call is missing for an IMPORTED target, or an ALIAS target
      
        is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithPresentation" links to target "gbm::gbm" but the
      
        target was not found.  Perhaps a find_package() call is missing for an
      
        IMPORTED target, or an ALIAS target is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
       Target "TWSampleWithQtWithPresentation" links to target "JPEG::JPEG" but
      
        the target was not found.  Perhaps a find_package() call is missing for an
      
        IMPORTED target, or an ALIAS target is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithPresentation" links to target "TIFF::TIFF" but
      
        the target was not found.  Perhaps a find_package() call is missing for an
      
        IMPORTED target, or an ALIAS target is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithPresentation" links to target "XCB::XINPUT" but
      
        the target was not found.  Perhaps a find_package() call is missing for an
      
        IMPORTED target, or an ALIAS target is missing?
      
       
      
      CMake Error at /usr/share/Qt/Linux-x64/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:559 (add_executable):
      
        Target "TWSampleWithQtWithPresentation" links to target
      
        "Qt6::EglFsKmsGbmSupportPrivate" but the target was not found.  Perhaps a
      
        find_package() call is missing for an IMPORTED target, or an ALIAS target
      
        is missing?
      

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            abhishek.mohata Abhishek Mohata
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes