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. error in compiling a project for android
Forum Update on Monday, May 27th 2025

error in compiling a project for android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidqmlqt6moc
4 Posts 2 Posters 601 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.
  • A Offline
    A Offline
    abdoll78
    wrote on 4 Feb 2023, 14:21 last edited by
    #1

    hello every one.
    i write an app with qml and successfully compile with mingw in windows but when i want build it for android it give me some error.

    :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
    make: *** [Makefile:1077: moc_person.cpp] Error 1
    make: *** Waiting for unfinished jobs....
    :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
    make: *** [Makefile:1006: moc_period.cpp] Error 1
    :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
    make: *** [Makefile:913: moc_myTranslator.cpp] Error 1
    :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
    make: *** [Makefile:799: moc_controller.cpp] Error 1
    17:29:13: The process "D:\android\SDK4\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited with code 2.
    Error while building/deploying project DarVish (kit: Android Qt 6.2.4 Clang x86_64)
    When executing step "Make"
    17:29:13: Elapsed time: 00:08.
    

    i useing qt 6.2.4 and android 12
    any idea how to solve this error?

    M 1 Reply Last reply 5 Feb 2023, 15:52
    0
    • A abdoll78
      4 Feb 2023, 14:21

      hello every one.
      i write an app with qml and successfully compile with mingw in windows but when i want build it for android it give me some error.

      :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
      make: *** [Makefile:1077: moc_person.cpp] Error 1
      make: *** Waiting for unfinished jobs....
      :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
      make: *** [Makefile:1006: moc_period.cpp] Error 1
      :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
      make: *** [Makefile:913: moc_myTranslator.cpp] Error 1
      :/Qt6.2/6.2.4/android_x86_64/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
      make: *** [Makefile:799: moc_controller.cpp] Error 1
      17:29:13: The process "D:\android\SDK4\ndk\23.1.7779620\prebuilt\windows-x86_64\bin\make.exe" exited with code 2.
      Error while building/deploying project DarVish (kit: Android Qt 6.2.4 Clang x86_64)
      When executing step "Make"
      17:29:13: Elapsed time: 00:08.
      

      i useing qt 6.2.4 and android 12
      any idea how to solve this error?

      M Offline
      M Offline
      mvuori
      wrote on 5 Feb 2023, 15:52 last edited by
      #2

      When it comes to compiling for Android, the most critical tool is the Android NDK and its correct version for the Qt version used.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        abdoll78
        wrote on 5 Feb 2023, 16:09 last edited by
        #3

        I think NDK version is match because I successfully build galley app in an emulator and my phone.

        A 1 Reply Last reply 6 Feb 2023, 17:03
        0
        • A abdoll78
          5 Feb 2023, 16:09

          I think NDK version is match because I successfully build galley app in an emulator and my phone.

          A Offline
          A Offline
          abdoll78
          wrote on 6 Feb 2023, 17:03 last edited by
          #4

          I figure out this is because of Q_Object macro I added in those files.
          I don't know why the macro doesn't work maybe better open another post.
          in other posts people suggest to rerun the qmke to solve this problem but doesn't work for me
          anyone know why Q_Object macro doesn't work for android?

          1 Reply Last reply
          0

          1/4

          4 Feb 2023, 14:21

          • Login

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