Default Include Path and using INCLUDEPATH
-
Hi,
I've been trying to add paths to search for headers using the INCLUDEPATH in the .pro file. I understand "INCLUDEPATH += /some/directory" appends to the include paths searched, but from what I am seeing in my project, the path I append is searched before the default ones.
For example, I have "#include <default.h>" which is found in the default paths checked without adding any new paths, but also have "#include <someother.h>", which is not found in the default paths. When I use INCLUDEPATH and append a new directory path, both default.h and someother.h are found in the newly appended directory. I expected the default.h to still be used from the default path though. Am I misunderstanding how the include paths are searched when new ones are appended?
Also, what are the default include paths or where are they defined in QT?
Thanks
-
Hi,
I've been trying to add paths to search for headers using the INCLUDEPATH in the .pro file. I understand "INCLUDEPATH += /some/directory" appends to the include paths searched, but from what I am seeing in my project, the path I append is searched before the default ones.
For example, I have "#include <default.h>" which is found in the default paths checked without adding any new paths, but also have "#include <someother.h>", which is not found in the default paths. When I use INCLUDEPATH and append a new directory path, both default.h and someother.h are found in the newly appended directory. I expected the default.h to still be used from the default path though. Am I misunderstanding how the include paths are searched when new ones are appended?
Also, what are the default include paths or where are they defined in QT?
Thanks
@stryker said in Default Include Path and using INCLUDEPATH:
Am I misunderstanding how the include paths are searched when new ones are appended?
No, it's correct, but this is also expected. Otherwise in no way you could use a header with the same name as the default.
Also, what are the default include paths or where are they defined in QT?
The default include path is set by your compiler, the Qt include paths are set by
qmake
and are dependent on where you installed Qt itself, but follow the pattern:QTBASEPATH/include/MODULENAME
.