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?
+3
A:
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.
Jason
2010-05-02 03:54:10
Okay. This will work for me just fine. Is there a global setting for include paths?
George Edison
2010-05-02 03:56:02
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
2010-05-02 04:02:08
@Jason: 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...
George Edison
2010-05-02 04:21:24
Never mind. Your answer mentions `INCLUDE_PATH` but you meant `INCLUDEPATH`. I'll fix your answer :)
George Edison
2010-05-02 04:23:33
Sorry about that. That's what I get for trying to do it from memory.
Jason
2010-05-02 04:55:28