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. strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...

strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...

Scheduled Pinned Locked Moved Solved Mobile and Embedded
8 Posts 4 Posters 21.2k 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
    aplastiras
    wrote on last edited by
    #1

    Hello to all,

    I am cross compiling for an embedded development board and I have some strange issues with qt creator. qtbase was compiled successfully for the target board.

    When I create a new project choosing the board that I want to build for, either a simple Console application or a QWidget application, from the first time that I configure the project, some issues appear in qt 'Issues' tab. Those issues concern the main types of like qt.

    For console

    0_1558371586873_20b97a24-50fc-481d-848c-c098dafb8134-image.png

    main.cpp:7: error: unknown type name 'QCoreApplication'

    For QWidget

    0_1558371651060_88b4daa5-2548-40a5-8b70-80b689d582c1-image.png

    main.cpp:6: error: variable has incomplete type 'QApplication'
    qwindowdefs.h:81: forward declaration of 'QApplication'
    main.cpp:7: error: unknown type name 'MainWindow'

    The most strange thing is that the console program compiles and runs successfully remotely on the board, which gives me the indication that

    Does anybody has any experience which any similar issue?

    Thank you in advance
    aplastiras

    aha_1980A 1 Reply Last reply
    0
    • A aplastiras

      Hello to all,

      I am cross compiling for an embedded development board and I have some strange issues with qt creator. qtbase was compiled successfully for the target board.

      When I create a new project choosing the board that I want to build for, either a simple Console application or a QWidget application, from the first time that I configure the project, some issues appear in qt 'Issues' tab. Those issues concern the main types of like qt.

      For console

      0_1558371586873_20b97a24-50fc-481d-848c-c098dafb8134-image.png

      main.cpp:7: error: unknown type name 'QCoreApplication'

      For QWidget

      0_1558371651060_88b4daa5-2548-40a5-8b70-80b689d582c1-image.png

      main.cpp:6: error: variable has incomplete type 'QApplication'
      qwindowdefs.h:81: forward declaration of 'QApplication'
      main.cpp:7: error: unknown type name 'MainWindow'

      The most strange thing is that the console program compiles and runs successfully remotely on the board, which gives me the indication that

      Does anybody has any experience which any similar issue?

      Thank you in advance
      aplastiras

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @aplastiras,

      these errors come from Creators Clang Code Model and are false positives. Such errors exists when Clang cannot parse a header file (for variouse reasons). I have them too on my ARM cross toolchain, but I didn't have the time to fully investigate the problem so far.

      You can either try that, or simply disable Clang in Help > About Plugins > Clang Code Model to fall back to the Classic Code Model.

      Regards

      Qt has to stay free or it will die.

      A 1 Reply Last reply
      7
      • A Offline
        A Offline
        aplastiras
        wrote on last edited by
        #3

        Thanks for your instant response

        After that every error disappeared.

        This solved the issues... thank you very much indeed.

        aha_1980A 1 Reply Last reply
        1
        • A aplastiras

          Thanks for your instant response

          After that every error disappeared.

          This solved the issues... thank you very much indeed.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @aplastiras Ok, then please mark this topic as SOLVED too. Thanks!

          Qt has to stay free or it will die.

          A 1 Reply Last reply
          0
          • aha_1980A aha_1980

            @aplastiras Ok, then please mark this topic as SOLVED too. Thanks!

            A Offline
            A Offline
            aplastiras
            wrote on last edited by SGaist
            #5

            @aha_1980 as I have no experience, I can say that I did mark the topic as SOLVED but it didn't

            now the selection MARK AS SOLVED does not exist any more.

            SGaistS 1 Reply Last reply
            0
            • A aplastiras

              @aha_1980 as I have no experience, I can say that I did mark the topic as SOLVED but it didn't

              now the selection MARK AS SOLVED does not exist any more.

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by SGaist
              #6

              Hi,

              @aplastiras said in strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...:

              @aha_1980 as I have no experience, I can say that I did mark the topic as SOLVED but it didn't

              now the selection MARK AS SOLVED does not exist any more.

              It's in the "Topic Tools" button.

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

              A 1 Reply Last reply
              1
              • SGaistS SGaist

                Hi,

                @aplastiras said in strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...:

                @aha_1980 as I have no experience, I can say that I did mark the topic as SOLVED but it didn't

                now the selection MARK AS SOLVED does not exist any more.

                It's in the "Topic Tools" button.

                A Offline
                A Offline
                aplastiras
                wrote on last edited by
                #7

                @SGaist said in strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...:

                Hi,

                @aplastiras said in strange 'variable has incomplete type' and 'forward declaration of 'QApplication' ' issues ...:

                @aha_1980 as I have no experience, I can say that I did mark the topic as SOLVED but it didn't

                now the selection MARK AS SOLVED does not exist any more.

                It's in the "Topic Tools" button.

                done... thank you

                1 Reply Last reply
                1
                • aha_1980A aha_1980

                  Hi @aplastiras,

                  these errors come from Creators Clang Code Model and are false positives. Such errors exists when Clang cannot parse a header file (for variouse reasons). I have them too on my ARM cross toolchain, but I didn't have the time to fully investigate the problem so far.

                  You can either try that, or simply disable Clang in Help > About Plugins > Clang Code Model to fall back to the Classic Code Model.

                  Regards

                  A Offline
                  A Offline
                  Alam2003
                  wrote on last edited by
                  #8

                  @aha_1980 mine is still error, is there any other way?

                  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