Кросс-компиляция Qt6 в Ubuntu 22.04C++

Программы на C++. Форум разработчиков
Ответить Пред. темаСлед. тема
Гость
 Кросс-компиляция Qt6 в Ubuntu 22.04

Сообщение Гость »


I'm having some troubles cross compiling Qt6 on Ubuntu 22.04 using mingw64 and CMake. The compilation process starts fine and all source files get compiled, but when I start looking for Qt components using

find_package(Qt6 REQUIRED COMPONENTS Core Widgets) I get the following error message

CMake Error at build/CMakeModules/cmake/find_qt.cmake:31 (find_package): Found package configuration file: /home/vinci/Downloads/QtPlayground/build/_deps/qt6-build/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/vinci/Downloads/QtPlayground/build/_deps/qt6-build/lib/cmake/Qt6Core/Qt6CoreConfig.cmake" exists Failed to find Qt component "Widgets". Expected Config file at "/home/vinci/Downloads/QtPlayground/build/_deps/qt6-build/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake" exists So apparently it found the package I've compiled but still refuses to use it for whatever reason. Could this be related to Qt complaining about missing libraries at the beginning of the compilation? That's the only thing I found so far that looks strange to me. E.g. here it complains about ZLIB missing.

-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) (Required is at least version "1.0.8") I don't understand why though. My toolchain file points it to the mingw64 installation which I assume contains zlib?
set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_SYSTEM_PROCESSOR x86_64) # specify the cross compiler set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) set(CMAKE_SYSROOT /usr/x86_64-w64-mingw32) # where is the target environment set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) set(QT_HOST_PATH "/usr" CACHE PATH "host path for Qt") set(Qt6HostInfo_DIR "/usr/lib/x86_64-linux-gnu/cmake/Qt6HostInfo" CACHE PATH "host path for Qt 6 info") # set the resource compiler (RHBZ #652435) set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) set(CMAKE_MC_COMPILER x86_64-w64-mingw32-windmc) # override boost thread component suffix as mingw-w64-boost is compiled with # threadapi=win32 set(Boost_THREADAPI win32) # These are needed for compiling lapack (RHBZ #753906) set(CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran) set(CMAKE_AR:FILEPATH x86_64-w64-mingw32-ar) set(CMAKE_RANLIB:FILEPATH x86_64-w64-mingw32-ranlib)

Источник: https://stackoverflow.com/questions/780 ... untu-22-04
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Разная ubuntu: кросс-компиляция ядра каждый раз перекомпилируется целиком
    Anonymous » » в форуме Linux
    0 Ответы
    51 Просмотры
    Последнее сообщение Anonymous
  • Связывание с кросс-скомпилированной статической библиотекой с использованием кросс-линкера не работает
    Anonymous » » в форуме Linux
    0 Ответы
    44 Просмотры
    Последнее сообщение Anonymous
  • Кросс-компиляция py-spidev для руки
    Гость » » в форуме Python
    0 Ответы
    49 Просмотры
    Последнее сообщение Гость
  • Кросс-компиляция libcurl для запуска на симуляторе iOS
    Anonymous » » в форуме IOS
    0 Ответы
    40 Просмотры
    Последнее сообщение Anonymous
  • Кросс-компиляция программы C++ для Windows на Debian с помощью Clang и Mingw-w64.
    Anonymous » » в форуме C++
    0 Ответы
    103 Просмотры
    Последнее сообщение Anonymous

Вернуться в «C++»