Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Was working then suddenly: QtGui/QApplication: No such file or directory. Why are the include files unavailable ?

Was working then suddenly: QtGui/QApplication: No such file or directory. Why are the include files unavailable ?

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 3 Posters 4.4k 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.
  • E Offline
    E Offline
    elpidiovaldez5
    wrote on 25 Jan 2014, 01:04 last edited by
    #1

    I have a largish project which was compiling well. Suddenly for no apparent reason QtCreator is complaining at:
    @#include <QtGui/QApplication> @

    I cannot see that I have changed anything significant. I feel that the installation of Qt has broken in some way. I found a mention of this problem on the net saying that clearing .qmake.cache solved the problem, but I cannot find this file.

    Any ideas ? What does it need to find this header ?

    I am using:
    Qt Creator 3.0.0
    Based on Qt 5.2.0 (GCC 4.6.1, 64 bit)

    1 Reply Last reply
    0
    • E Offline
      E Offline
      elpidiovaldez5
      wrote on 25 Jan 2014, 01:59 last edited by
      #2

      I am now sure that this is a bug in QtCreator. If I start a new project and copy in all the source/headers/forms of the failing project everything compiles well UNTIL I make an edit to LIBS and INCLUDEPATH. Then the system says it cannot find QtGui/QApplication. Undoing the edit to the LIBS and INCLUDEPATH does not cause the system to work again. It is now a dead project until it is completely created from scratch again. Some persistent data must get corrupted, but what ?

      1 Reply Last reply
      0
      • E Offline
        E Offline
        elpidiovaldez5
        wrote on 25 Jan 2014, 02:19 last edited by
        #3

        I have solved the problem. Looks like the code is wrong, but it is compiling until I force a clean or rebuild - then the error occurs. Any edit to the .pro file causes the rebuild it would appear. Please don't waste any time on this - like I have :)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 25 Jan 2014, 22:38 last edited by
          #4

          Hi,

          If for example your are doing
          @
          LIBS = -L/usr/lib/my_lib_path
          @

          or

          @
          INCLUDEPATH = /usr/include/my_include_path
          @

          You are in fact clearing these variables, you need to use e.g.

          @
          LIBS += -L/usr/lib/my_lib_path
          @

          Hope it helps

          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
          • J Offline
            J Offline
            JKSH
            Moderators
            wrote on 26 Jan 2014, 01:59 last edited by
            #5

            Hi,

            I'm surprised that it compiles in the first place.

            <QtGui/QApplication> exists in Qt 4, but has been changed to <QtWidgets/QApplication> in Qt 5. The previous header no longer works.

            The recommended approach is to do this, which will work on both Qt 4 and Qt 5:
            @
            #include <QApplication>
            @

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0

            4/5

            25 Jan 2014, 22:38

            • Login

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