This MSDN document quotes:
look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file
Wait, what?
What does that actually mean (the bold stuff)?
It probably means that if foo/bar/baz.c includes ../bog/bog.h, and the latter contains
#include "fix.h"
it would find foo/bar/fix.h. In other words, it looks in the directory that contained the C file that included the header containing the include. Clear? :)
So, the file layout rendered as gorgeous ASCII graphics, is:
foo/
|
+-bar/
| |
| +-baz.c
| |
| +-fix.h
|
+-bog/
|
+-bog.h
And bog.h is then able to find fix.h in the sibling directory foo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With