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. Cross compile Qt for Windows with MinGW64
QtWS25 Last Chance

Cross compile Qt for Windows with MinGW64

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 707 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.
  • O Offline
    O Offline
    ozaq
    wrote on last edited by ozaq
    #1

    I am trying to accomplish a Linux to Windows cross build of QT with MinGW64 with the current source tarball (https://download.qt.io/official_releases/qt/6.2/6.2.2/single/qt-everywhere-src-6.2.2.tar.xz)

    I have found some helpful documentation in https://github.com/qt/qtbase/blob/6.2.2/cmake/README.md, with this I am able to build QT for the host system. According to the doc I first need a host build of QT for the cross build to generate sources. Building QT for the host system works as described in the link.

    However if I am them attempting the the cross build with CMake, i.e.

    cmake <path-to-sources> -GNinja \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_SYSTEM_NAME=Windows \
        -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc-posix \
        -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-c++-posix \
        -DQT_HOST_PATH=/path-to-host-build
    

    I am running into an error:

    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
    

    Any idea why this is happening in the cross build and not in the host build?

    Or should I use the configure script instead? I did find blog post like this one: https://medium.com/@vladadgad/cross-compile-qt-for-windows-on-linux-platform-57e4b71ed1aa however the options passed to configure are not mentioned in configure --help . Ideally I am looking for a pointer to the right documentation how to cross build with either the configure script or with cmake directly.

    Thanks for reading, any help is appreciated.

    1 Reply Last reply
    0
    • O Offline
      O Offline
      ozaq
      wrote on last edited by
      #2

      Unfortunately I have not made any progress on this issue since posting this. Is anyone aware of a better place to ask this question?

      Any help would be very much appreciated.

      raven-worxR 1 Reply Last reply
      0
      • O ozaq

        Unfortunately I have not made any progress on this issue since posting this. Is anyone aware of a better place to ask this question?

        Any help would be very much appreciated.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @ozaq
        this thread might help:
        https://forum.qt.io/topic/132307/qt6-cross-compile-for-windows

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        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