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. Building QT 6 for Android on Windows from sources
QtWS25 Last Chance

Building QT 6 for Android on Windows from sources

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 795 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.
  • D Offline
    D Offline
    Dmitriano
    wrote on 27 Mar 2021, 18:02 last edited by
    #1

    Tried to build QT for Android on Windows according to this: https://doc-snapshots.qt.io/qt6-dev/android-building.html

    But did not figure out

    1. what is the difference between "-prefix <\path\to\install>" and "-qt-host-path <path_to_host_qt_installation>" "configure.bat" parameters
    2. how to specify -DQT_NO_EXCEPTIONS as "configure.bat" parameter

    Tried the following:

    set "MY_INSTALL_PATH=E:\Qt\Qt6.0.2\android"
    set QT_HOST_PATH=%MY_INSTALL_PATH%

    rem QT_NO_EXCEPTIONS disables "try { } catch (...) {}" surrounding the user code in qthread_unix.cpp
    configure.bat -prefix %MY_INSTALL_PATH% -qt-host-path %MY_INSTALL_PATH% -DQT_NO_EXCEPTIONS=1 -release -force-debug-info -platform win32-g++ -opengl es2 -xplatform android-clang ^
      -android-ndk %ANDROID_NDK_PATH% -android-sdk %ANDROID_SDK_ROOT% -android-abis arm64-v8a -android-ndk-host windows-x86_64 ^
      -opensource -confirm-license -nomake tests -nomake examples
    

    but got:

    Configuring 'qtbase'
    -- Android NDK detected: C://Users//D-Ef//AppData//Local//Android//Sdk/ndk-bundle
    -- Android toolchain file detected
    CMake Error at qtbase/cmake/QtSetup.cmake:173 (message):
      You need to set QT_HOST_PATH to cross compile Qt.
    Call Stack (most recent call first):
      qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:173 (include)
      qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:271 (qt_build_internals_set_up_private_api)
      qtbase/CMakeLists.txt:57 (qt_build_repo_begin)
    
    -- Configuring incomplete, errors occurred!
    
    1. where should I set QT_HOST_PATH?
    2. how to clean the configuration (after executing configure.bat with wrong parameters)?
    1 Reply Last reply
    1
    • X Offline
      X Offline
      xtofl
      wrote on 30 Mar 2021, 08:00 last edited by
      #2

      1.b https://www.qt.io/blog/qt-6-build-system seems to contain some information on this.

      The QT_HOST_PATH is to be set by using the -qt-host-path switch.

      To cross-build Qt, you need to point to an already existing native build of your host platform. This is called the host Qt.

      D 1 Reply Last reply 30 Mar 2021, 21:33
      0
      • X xtofl
        30 Mar 2021, 08:00

        1.b https://www.qt.io/blog/qt-6-build-system seems to contain some information on this.

        The QT_HOST_PATH is to be set by using the -qt-host-path switch.

        To cross-build Qt, you need to point to an already existing native build of your host platform. This is called the host Qt.

        D Offline
        D Offline
        Dmitriano
        wrote on 30 Mar 2021, 21:33 last edited by Dmitriano
        #3

        @xtofl yes, I see, but what is QT_HOST_PATH?

        And why am I getting the error

        You need to set QT_HOST_PATH to cross compile Qt
        

        if I set it with -qt-host-path?

        1 Reply Last reply
        0
        • N Offline
          N Offline
          Nick Bennett
          wrote on 31 May 2024, 10:09 last edited by
          #4

          On Windows, the default path would be C:\Qt. (This is where the Qt Online Installer would install it)

          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