Installed Qt6 6.3.1 on linux x64 host machine and Qt::Core not found *not resolved*
-
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/5I 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 -
A little bit more detailed would be nice.
Guessing you are not linking the module correctly.target_link_libraries(your_target PRIVATE Qt6::Core);
-
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"
existsFailed to find Qt component "Gui".
Expected Config file at
"/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Gui/Qt6GuiConfig.cmake" existsFailed to find Qt component "Widgets".
Expected Config file at
"/home/michal/Qt6/6.3.1/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake"
existsWhile 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) -
@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? -
@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?@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! -
@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?