Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Got compile error when build Qt 6.7.2 for Android
Forum Updated to NodeBB v4.3 + New Features

Got compile error when build Qt 6.7.2 for Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 405 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.
  • Y Offline
    Y Offline
    ytexas
    wrote on 11 Aug 2024, 13:49 last edited by ytexas 8 Nov 2024, 13:50
    #1

    Hi everyone,

    I'm trying build qt for android with the doc android-building. But got a build error may need your help

    My environment is Archlinux. I used to success built a qt application for android by qt5 (years ago). And recently I'd like to trying build qt 6.7.2 for android.

    I installed android sdk and ndk by sdk manager. According to the doc. I have done the host building and installed host tools by:

    cd qt6.7.2-host
    mkdir build
    cd build
    cmake .. -G Ninja -DFEATURE_developer_build=ON -DCMAKE_INSTALL_PREFIX=~/Qt/6.7.2-host
    cmake --build . --parallel
    cmake --install .
    

    But got compile error when trying to build qt for andorid with following commands:

    cd qt6.7.2-android
    mkdir build
    cd build
    cmake ..  -G Ninja -DCMAKE_BUILD_TYPE=Release  \ 
      -DQT_HOST_PATH=~/Qt/6.7.2-host \
      -DCMAKE_INSTALL_PREFIX=~/Qt/6.7.2-android \
      -DCMAKE_ANDROID_ARCH_ABI=x86_64 \
      -DANDROID_SDK_ROOT=~/Android/sdk \
      -DANDROID_NDK=~/Android/Sdk/ndk/27.0.12077973
    
    # and got compile error here
    cmake --build . --parallel 
    

    And got compile error message:

    Android/Sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/c++/v1/__utility/declval.h:31:17: error: static assertion failed due to requirement '!__is_same(float, float)': std::declval can only be used in an unevaluated context. It's likely that your current usage is trying to extract a value from the function.
       31 |   static_assert(!__is_same(_Tp, _Tp),
          |                 ^~~~~~~~~~~~~~~~~~~~
    qt6.7.2-android/qtbase/src/corelib/kernel/qjnitypes.h:130:26: note: in instantiation of function template specialization 'std::declval<float>' requested here
      130 |     return function(std::declval<Args>()...);
          |                          ^
    

    So my question is:

    • what dose this compile error means?
    • is there some configuration or steps I missed?
    • how to fix this compile error to build a qt 6.7.2 for andorid?

    Thanks!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mvuori
      wrote on 11 Aug 2024, 16:03 last edited by
      #2

      I don't know anything about this, but as the same code has compiled for developers at Qt using an older NDK, I'd suspect its compiler, and would try downgrading the NDK.

      Y 1 Reply Last reply 12 Aug 2024, 06:03
      0
      • M mvuori
        11 Aug 2024, 16:03

        I don't know anything about this, but as the same code has compiled for developers at Qt using an older NDK, I'd suspect its compiler, and would try downgrading the NDK.

        Y Offline
        Y Offline
        ytexas
        wrote on 12 Aug 2024, 06:03 last edited by
        #3

        @mvuori Thanks for reply,

        I have tried downgraded NDK version, from 26.x to 22.x, event the 26.1.10909125 which is the same version of NDK used in the document. All of them would got compile error (may have different error messages like missing wchar.h ).

        1 Reply Last reply
        0

        1/3

        11 Aug 2024, 13:49

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved