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. Q_Object macro Does't work for android
QtWS25 Last Chance

Q_Object macro Does't work for android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
qmlandroidmocqt6
3 Posts 2 Posters 536 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 6 Feb 2023, 17:58 last edited by
    #1

    Re: compiling QT for Android with Q_Object macro
    hello eveyone.
    I create a empty QML project then I add a .h/.cpp file to the project and can compile it successfully but when I adding Q_Object on the class in a .cpp file and trying to compile it give me this error.

    :/Qt6.2/6.2.4/android_armv7/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
    make: *** [Makefile:566: moc_junk.cpp] Error 1
    make: *** Waiting for unfinished jobs....
    21:22:40: 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 FQT (kit: Android Qt 6.2.4 Clang armeabi-v7a)
    When executing step "Make"
    

    I try to clean the project and rerun the qmake but doesn't work for me.
    I can build without Q_Object macro but when i add the macro it give me error.
    enyone have any idea how solve this problem

    J 1 Reply Last reply 6 Feb 2023, 18:10
    0
    • A abdoll78
      6 Feb 2023, 17:58

      Re: compiling QT for Android with Q_Object macro
      hello eveyone.
      I create a empty QML project then I add a .h/.cpp file to the project and can compile it successfully but when I adding Q_Object on the class in a .cpp file and trying to compile it give me this error.

      :/Qt6.2/6.2.4/android_armv7/include/QtCore/qnamespace.:56:1: error: Parse error at "__attribute__"
      make: *** [Makefile:566: moc_junk.cpp] Error 1
      make: *** Waiting for unfinished jobs....
      21:22:40: 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 FQT (kit: Android Qt 6.2.4 Clang armeabi-v7a)
      When executing step "Make"
      

      I try to clean the project and rerun the qmake but doesn't work for me.
      I can build without Q_Object macro but when i add the macro it give me error.
      enyone have any idea how solve this problem

      J Online
      J Online
      JoeCFD
      wrote on 6 Feb 2023, 18:10 last edited by
      #2

      @abdoll78 said in Q_Object macro Does't work for android:

      error: Parse error at "attribute"

      https://forum.qt.io/topic/133614/qt6-2-1-moc-exe-includes-wrong-directory/4

      A 1 Reply Last reply 8 Feb 2023, 18:46
      0
      • J JoeCFD
        6 Feb 2023, 18:10

        @abdoll78 said in Q_Object macro Does't work for android:

        error: Parse error at "attribute"

        https://forum.qt.io/topic/133614/qt6-2-1-moc-exe-includes-wrong-directory/4

        A Offline
        A Offline
        abdoll78
        wrote on 8 Feb 2023, 18:46 last edited by
        #3

        @JoeCFD
        thank you so much for your reply. you save me from this problem.
        i solve this by removing other mingW compiler and it work properly.

        1 Reply Last reply
        0
        • A abdoll78 has marked this topic as solved on 8 Feb 2023, 18:47

        2/3

        6 Feb 2023, 18:10

        • Login

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