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. Fatal error: QObject: No such file or directory
QtWS25 Last Chance

Fatal error: QObject: No such file or directory

Scheduled Pinned Locked Moved Solved Mobile and Embedded
android studiondkqobjectandroid
5 Posts 2 Posters 9.5k 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.
  • S Offline
    S Offline
    Sanders
    wrote on 6 Mar 2016, 21:13 last edited by Sanders 3 Jun 2016, 21:48
    #1

    Hi guys, I developed an android application using Android studio and now I would like to include a native part. So I start developing this part using Qt and now I would like to include sources files in my application.

    My problem is I got the following errors : fatal error: QObject: No such file or directory

    Notice : I use the : android-ndk-r10e and my Android.mk file looks like :

    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    LOCAL_MODULE := qt-signaux
    
    LOCAL_SRC_FILES += com_example_qtsignaux_Library.cpp
    LOCAL_SRC_FILES += Emitter.cpp
    
    TARGET_ARCH_ABI += armeabi
    #Allows to enable android log
    LOCAL_LDLIBS := -llog
    
    include $(BUILD_SHARED_LIBRARY)
    
    

    Thks in advance guys

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 6 Mar 2016, 21:19 last edited by
      #2

      Hi and welcome to devnet,

      Since you're not using Qt's qmake .pro file your going to have to tell your script where to find Qt's headers and libraries as well as run the tools like moc or rcc by hand.

      I don't know how to do that from an Android.mk file though.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply 7 Mar 2016, 08:57
      0
      • S SGaist
        6 Mar 2016, 21:19

        Hi and welcome to devnet,

        Since you're not using Qt's qmake .pro file your going to have to tell your script where to find Qt's headers and libraries as well as run the tools like moc or rcc by hand.

        I don't know how to do that from an Android.mk file though.

        S Offline
        S Offline
        Sanders
        wrote on 7 Mar 2016, 08:57 last edited by Sanders 3 Jul 2016, 08:58
        #3

        @SGaist Hi SGaist. Thanks for your reply.Might be possible to generate a shared library usable in Android using qt and qmake? I mean develop my native code as a qt project, export it as a library and then include it in my android project?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 16 Mar 2016, 23:54 last edited by
          #4

          Technically Qt is a set of shared libraries that you use to build an Android application so possible I'd say yes but I don't know how to do it using Android's NDK original build system.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Sanders
            wrote on 1 Aug 2016, 09:21 last edited by
            #5

            I finally found my issue. My include path did not point to the great folder (the one containing the QObject header)

            To fix it I used the include path flag with the ndk-build command

            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