Can I have a directoryA which contains directoryB, directoryC, directoryD and include one of the sub directory in my sketch?
I've tried, but
error: directoryA/directoryB.h: No such file or directory
Can I have a directoryA which contains directoryB, directoryC, directoryD and include one of the sub directory in my sketch?
I've tried, but
error: directoryA/directoryB.h: No such file or directory
and include one of the sub directory in my sketch?
You can't include a sub directory in a sketch, but you can include a file in a sub directory, if you use the proper relative path syntax.
#include "../dir/dir/file.h"
or
#include "./dir/dir/file.h"
depending on where the file is relative to where the sketch is.
Of course, you can include using absolute paths, too.
I have this problem also. I put this path in my sketch:
#include "../../NECIRrcv.h"
This is the correct relative path, but it does not work. I'm using Windows 7, so I also tried using backslashes () and double backslashes (\) in case there's a problem with the string escaping those characters. Nothing works. Help!
The path needs to be relative to the sketch path. That relative path does not look right.
It is right. The sketch is stored at: C:\Users\laserjockey\Documents\Arduino\NECIRrcv\examples\printcodes
and the library is located at: C:\Users\laserjockey\Documents\Arduino\NECIRrcv
so you see:
../ gets me to examples
../ gets me to NECIRrcv
and NECIRrcv.h is the name of the header file.