# Deep in the folder

• Deep in the directory tree are my personal library-files and instead of writing the whole directory tree i.e.
#include "C:\Dev\persoal\list\of\my\library\that\only\I\can\use\in\my\programs\myfile.h"
I would rather just write:
#include "myfile.h"

INCLUDEPATH += C:\Dev\persoal\list\of\my\library\that\only\I\can\use\in\my\programs


• Hi,

To add to @Wieland, since you are using Qt, you should use forward slashes in your paths (the unix notation) that will avoid having to escape every backslashes.

• @Wieland said:

INCLUDEPATH += C:\Dev\persoal\list\of\my\library\that\only\I\can\use\in\my\programs

Under the [INCLUDEPATH] is a file named i.e. "thunder.hpp". So the directory tree looks like this
[INCLUDEPATH]
| ----- thunder.hpp {FILE}
|----->Message {DIRECTORY}
|-----message.hpp {FILE}
|------message.cpp {FILE}

Now, in my main.c, created by Qt Creator, I have include these files like this:
#include "thunder.hpp"
#include "Message/message.hpp"

but this gives me an error saying:
C:....\main.cpp:8: error: C1083: Cannot open include file: 'thunder.hpp': No such file or directory.

But if I modify the code in main.c to look like this
#include "C:\Dev\persoal\list\of\my\library\that\only\I\can\use\in\my\programs\thumder.hpp"
then the program compiles.

It seems to me that setting up the INCLUDEPATH variable in the .pro file fails to read the files under the INCLUDEPATH and it only reads the sub-directories under it. Is this the right assumption, or is there something wrong with my code?

How can I solve this problem?

• @Papa said:

#include "thunder.hpp"
#include "Message/message.hpp"

Try to replace this by:

#include <thunder.hpp>
#include <Message/message.hpp>


• tried it, but it did not work :(

• Just tested it. Works for me. Clean the project and re-run qmake.

• Nope, it does not work.

• Did you changed the backslashes to forward-slashes as SGaist suggested?