Take the 2-minute tour ×

I have a project I'm working on in Qt creator that requires a third-party library. I want to add the headers to the include path for the project. How do I do this?

share|improve this question
add comment

2 Answers

up vote 83 down vote accepted

If you are using qmake, the standard Qt build system, just add a line to the .pro file:

INCLUDEPATH += <your path>

If you are using your own build system, you create a project by selecting "Import of Makefile-based project". This will create some files in your project directory including a file named <your project name>.includes. In that file, simply list the paths you want to include, one per line. Really all this does is tell Qt Creator where to look for files to index for auto completion. Your own build system will have to handle the include paths in its own way.

share|improve this answer
Okay. This will work for me just fine. Is there a global setting for include paths? –  Nathan Osman May 2 '10 at 3:56
Not that I know of, but that doesn't mean there isn't. I don't see anything in the options that looks like that. –  Jason B May 2 '10 at 4:02
It isn't working now... I have the following: INCLUDE_PATH += "C:/users/xxx/documents/projects/xxx/include" and it's not finding the files in there... –  Nathan Osman May 2 '10 at 4:21
Never mind. Your answer mentions INCLUDE_PATH but you meant INCLUDEPATH. I'll fix your answer :) –  Nathan Osman May 2 '10 at 4:23
Sorry about that. That's what I get for trying to do it from memory. –  Jason B May 2 '10 at 4:55
show 2 more comments

To add global include path use custom command for qmake in Projects/Build/Build Steps section in "Additional arguments" like this: "QT+=your_qt_modules" "DEFINES+=your_defines"

I think that you can use any command from *.pro files in that way.

share|improve this answer
add comment

Your Answer


