Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*
Forum Updated to NodeBB v4.3 + New Features

Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 4.0k 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.
  • H Offline
    H Offline
    Harlock21
    wrote on last edited by
    #1

    Hi all,
    I am recalling the same problem that has been discussed on this thread a bit before:
    https://forum.qt.io/topic/134586/installed-qt6-to-linux-cmake-target-qt6-core-was-not-found/5

    I have tried cmake 3.22.5 just as 3.24.0-rc2 and the issue is still the same as of the parent thread.

    CMakeLists.txt:
    

    cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
    project(testQt6)
    set(CMAKE_CXX_STANDARD 17)
    find_package(Qt6 REQUIRED COMPONENTS Core)

    CMake command:
    

    cmake .. -DCMAKE_PREFIX_PATH="/usr/michal/Qt6/6.3.1/gcc_64/lib/cmake"

    The error is still the one reported in the parent thread.
    Has anyone tested if there is something wrong with Qt ver 6.3.1?
    Thanks

    1 Reply Last reply
    0
    • H Offline
      H Offline
      huppeldepup
      wrote on last edited by
      #2

      A little bit more detailed would be nice.
      Guessing you are not linking the module correctly.

      target_link_libraries(your_target PRIVATE Qt6::Core);
      
      1 Reply Last reply
      1
      • H Offline
        H Offline
        Harlock21
        wrote on last edited by
        #3

        This is the output:

        cmake .. -DCMAKE_PREFIX_PATH="/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6"
        -- The C compiler identification is GNU 10.2.1
        -- The CXX compiler identification is GNU 10.2.1
        -- Detecting C compiler ABI info
        -- Detecting C compiler ABI info - done
        -- Check for working C compiler: /usr/bin/cc - skipped
        -- Detecting C compile features
        -- Detecting C compile features - done
        -- Detecting CXX compiler ABI info
        -- Detecting CXX compiler ABI info - done
        -- Check for working CXX compiler: /usr/bin/c++ - skipped
        -- Detecting CXX compile features
        -- Detecting CXX compile features - done
        -- Looking for pthread.h
        -- Looking for pthread.h - found
        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
        -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
        -- Check if compiler accepts -pthread
        -- Check if compiler accepts -pthread - yes
        -- Found Threads: TRUE
        -- Performing Test HAVE_STDATOMIC
        -- Performing Test HAVE_STDATOMIC - Success
        -- Found WrapAtomic: TRUE
        -- Could NOT find Qt6CoreTools (missing: Qt6CoreTools_DIR)
        CMake Warning at /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
        Found package configuration file:

        /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake
        

        but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
        NOT FOUND. Reason given by package:

        Target "Qt6::Core" was not found.

        Call Stack (most recent call first):
        CMakeLists.txt:4 (find_package)

        -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
        -- Found WrapOpenGL: TRUE
        -- Found XKB: /usr/lib/x86_64-linux-gnu/libxkbcommon.so (found suitable version "1.0.3", minimum required is "0.5.0")
        -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR)
        -- Could NOT find Qt6GuiTools (missing: Qt6GuiTools_DIR)
        CMake Warning at /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
        Found package configuration file:

        /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake
        

        but it set Qt6Gui_FOUND to FALSE so package "Qt6Gui" is considered to be
        NOT FOUND. Reason given by package:

        Target "Qt6::Gui" was not found.

        Call Stack (most recent call first):
        CMakeLists.txt:4 (find_package)

        -- Could NOT find Qt6WidgetsTools (missing: Qt6WidgetsTools_DIR)
        CMake Warning at /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:213 (find_package):
        Found package configuration file:

        /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake
        

        but it set Qt6Widgets_FOUND to FALSE so package "Qt6Widgets" is considered
        to be NOT FOUND. Reason given by package:

        Target "Qt6::Widgets" was not found.

        Call Stack (most recent call first):
        CMakeLists.txt:4 (find_package)

        CMake Error at CMakeLists.txt:4 (find_package):
        Found package configuration file:

        /home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6/Qt6Config.cmake
        

        but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
        FOUND. Reason given by package:

        Failed to find Qt component "Core".

        Expected Config file at
        "/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Core/Qt6CoreConfig.cmake"
        exists

        Failed to find Qt component "Gui".

        Expected Config file at
        "/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake" exists

        Failed to find Qt component "Widgets".

        Expected Config file at
        "/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake"
        exists

        While the testing cmake file is the one of the thread upper mentioned:

        cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
        project(testQt6)
        set(CMAKE_CXX_STANDARD 17)
        find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Harlock21
          wrote on last edited by
          #4

          There is something that is breaking the linux installation, have done it many times but it did not help anyway.

          1 Reply Last reply
          0
          • kkoehneK Offline
            kkoehneK Offline
            kkoehne
            Moderators
            wrote on last edited by
            #5

            @Harlock21 said in Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*:

            CMAKE_PREFIX_PATH="/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6"

            Can you try setting it just to

            CMAKE_PREFIX_PATH=/home/michal/Qt6/6.3.1/gcc_64

            ?

            If that doesn't succeed, can you re-run cmake with --trace option, pipe the (very verbose!) output to e.g. a file, and then share it here?

            Director R&D, The Qt Company

            H 1 Reply Last reply
            2
            • H Offline
              H Offline
              Harlock21
              wrote on last edited by
              #6

              Thanks a lot!
              This did the trick, so then we need to pass the qt root folder and not the lib/cmake/qt6 one.

              1 Reply Last reply
              0
              • kkoehneK kkoehne

                @Harlock21 said in Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*:

                CMAKE_PREFIX_PATH="/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6"

                Can you try setting it just to

                CMAKE_PREFIX_PATH=/home/michal/Qt6/6.3.1/gcc_64

                ?

                If that doesn't succeed, can you re-run cmake with --trace option, pipe the (very verbose!) output to e.g. a file, and then share it here?

                H Offline
                H Offline
                Harlock21
                wrote on last edited by Harlock21
                #7

                @kkoehne still thanks for your reply.
                I however am facing the same issue once again when I am trying to deploy my sample app with the cross compiled qt6 for the arm64 target.
                So to clarify, if I am going to set the CMAKE_PREFIX_PATH to the gcc_64 installed qt the cmake find rules pass and I can build my sample app - BUT - if I am going to set the CMAKE_PREFIX_PATH to the cross-compiled qt (in my case it is: $HOME/rpi/qt6-raspi) I am facing once agian the issue as explained above.
                I also tried to pass a minimalistic toolchain file with the -DCMAKE_TOOLCHAIN_FILE flag but it did not help so much.
                Any help will be greatly appreciated, thanks!

                1 Reply Last reply
                0
                • kkoehneK Offline
                  kkoehneK Offline
                  kkoehne
                  Moderators
                  wrote on last edited by
                  #8

                  @Harlock21 said in Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*:

                  however am facing the same issue once again when I am trying to deploy my sample app with the cross compiled qt6 for the arm64 target.

                  Is it really showing the exact same error, or is it that it misses the 'host Qt'? How did you configure the cross-compiled Qt?

                  Director R&D, The Qt Company

                  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