PDA

View Full Version : Editor unable to find Header Files



weaver4
10th May 2012, 16:46
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?

Lykurg
10th May 2012, 17:41
#include <QtCore>/QCoreApplication>Syntax error?

weaver4
10th May 2012, 18:20
Sorry, it is a typo above, but it is correct in the editor.

ChrisW67
11th May 2012, 04:28
Try


#include <QCoreApplication>
// or
#include <QApplication>

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.

weaver4
11th May 2012, 21:52
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.