Adding search directory in Qt IDE
-
wrote on 1 Oct 2013, 04:24 last edited by
I would like to add a very long path directly into my Qt project, so that I don't have to write something like:
@#include "C:\dir1\dir2\dir3\dir4\dir5\dir6\dir7\dir8\my_header.hpp"@
Can this be done using QTIDE?
Thanks
-
This has nothing to do with Qt Creator. You need to add your header to INCLUDEPATH in you .pro file (if you are using qmake):
@
INCLUDEPATH+=C:/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8
@Then, in your source file:
@
#include "my_header.hpp"
@On a related note, don't use absolute paths in your source code! Make them relative to your project's root directory. Otherwise your code will not be useful on other machines.
2/2