Results 1 to 5 of 5

Thread: Editor unable to find Header Files

  1. #1
    Join Date
    Nov 2009
    Posts
    68
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded

    Default Editor unable to find Header Files

    In a new console project the first line is:

    #include <QtCore/QCoreApplication>

    If I hover over this line the editor says: "No such file or Directory"

    If I Build and Run it compiles and runs fine.

    It appears that the Editor can not find the header files but the compiler can. Without this working Code Completion does not work.

    I am using Qt Creator 2.0.1

    What can I do to resolve this?
    Last edited by weaver4; 10th May 2012 at 18:20.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Editor unable to find Header Files

    Quote Originally Posted by weaver4 View Post
    #include <QtCore>/QCoreApplication>
    Syntax error?

  3. #3
    Join Date
    Nov 2009
    Posts
    68
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded

    Default Re: Editor unable to find Header Files

    Sorry, it is a typo above, but it is correct in the editor.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Editor unable to find Header Files

    Try
    Qt Code:
    1. #include <QCoreApplication>
    2. // or
    3. #include <QApplication>
    To copy to clipboard, switch view to plain text mode 
    like the examples in the docs. You also want to update your QtCreator. Creator 2.4 is in the Qt SDK, 2.5 has just hit the streets, and both have greatly improved code completion.

  5. #5
    Join Date
    Nov 2009
    Posts
    68
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded

    Default Re: Editor unable to find Header Files

    That did not fix it.

    For some reason QTCreator does not know where the include files are. The compiler finds the include files because it compiles fine. So QT creator must not get the Include files directory the same place the compiler does (from mkspec).

    So how does QTCreator know where the QT header files are? And how do you change it?


    Added after 1 11 minutes:


    Updated to the latest SDK/Creator and the problem went away.

    Thanks for your help.
    Last edited by weaver4; 11th May 2012 at 21:52.

Similar Threads

  1. QSqlTableModel Unable to find table with SQlite
    By qlands in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2011, 14:33
  2. QPSQL: Unable to find table set in a QSqlTableModel
    By andreabiscuola in forum Qt Programming
    Replies: 7
    Last Post: 18th January 2011, 23:33
  3. Replies: 1
    Last Post: 3rd February 2010, 06:01
  4. QSqlRelationalTableModel settable unable to find
    By nietzsche in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2009, 22:51
  5. unable to include header file
    By sonia in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 08:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.