How to add include directory to Qt project

The method to add an include directory to a Qt project depends on how the project was created.

If the project has a .pro file, then add this line to it:

INCLUDEPATH += "C:\some\include\path"

If you have Qt Creator open with the project, you can find the .pro file under the project name. Alternatively, you can use any editor to edit this file. Remember to run qmake after adding the include directory.

If the project has a .includes file, then just add the path directly to it:

C:\some\include\path

Tried with: Qt 5.2.0 and Windows 7 x64

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s