I stumbled upon the following unexpected behaviour and am curious about its cause.
header.h:
#include <Time.h>
[...]
main.ino:
#include "header.h"
#include <Time.h>
[...]
My code is working correctly with this setup. However, if I comment out the Time.h library in my main.ino, my code is working not correctly anymore:
#include "header.h"
//#include <Time.h>
[...]
I can still access the functions of Time.h, but they are returning garbage time.
Why do I have to include the library in my *.ino, although I am already including it in my header file? Is there a best practice, on where to include libraries? Shall I simply always include all libraries in my *.h and *.ino file?