Where to setup QT creator to locate all Qt include files?
Qt Creator 1.3.1
Based on Qt 4.6.2 (64 bit)
When I import some files into Qt, I have build errors.
For example,, I declare this include in a file:
When I move cursor over the line the tool tip show this:
When I looked into my Linux Ubuntu folder
I only found QHostAddress in this folder:
So, it seems Qt Creator cannot find the include file.
I was able to compile QT without my imported files.
I am perplex as to why I cannot do so with the inclusion of the imported file, since the includes were all Qt's include files.
Please be specific about how i can tell Qt creator to search appropriate folders.
I created another test application, and included
int main(int argc, char *argv)
QApplication a(argc, argv);
Error warning is this:
QHostAddress: No such file or directory.
Excuse me but what is the difference between
QHostAddress in this folder:
About your problem, do you have
QT += network
in your .pro file?
Did you add network in your pro file? Like..
QT += core gui network
As for includes, you have two types, you could include globally using the class name like
Or a qualified path like
Both of these work, because the Qt include directories contains the global directory as well as the directory below for each module.
Is that the issue or is it something else? Maybe, your Qt sources are not structured correctly..
@ usr/qt4/QtNetwork @
You're on linux i'm guessing and in linux the Qt includes (including the QtNetwork folder) are usually in a "include" folder. Anyway hope that sheds some light on your problem.
[ Edit: @loladiro: Same time same place again :) ]
Where do you find information on what to include inn *;pro file?
Qt has several modules for which you can find an overview "here ":http://doc.qt.nokia.com/4.7/modules.html
If you click on a module you will see an explanation which also states which option to set in your pro file like the example shown to you.
[quote author="hpng" date="1308678213"]Where do you find information on what to include inn *;pro file?
It is indeed a little hidden. But you can find it in the module description (e.g. "here":http://doc.qt.nokia.com/4.7/qtnetwork.html for QtNetwork). FYI, you can see what module it is in by looking at the breadcrumbs at the top of the page (e.g. Home -> Modules -> QtNetwork -> QHostAddress )
Edit: Eddy was faster ;)
@loladiro Just once ;)
Man you're fast!