TimeLib compilation-error ?

wm1962

New member
I've a huge project (Board Teensy 3.5 and Arduino IDE 1.8.8, Teensyduino 1.46) and since some days I'll get an error at compilationtime:

Code:
Test_Time:3: error: aggregate 'tm mytm' has incomplete type and cannot be defined
 struct tm mytm;

I reduced the code to the minimum and the error ist still there:
Code:
#include <Time.h>        // https://github.com/PaulStoffregen/Time
#include <TimeLib.h>   
struct tm mytm;

void setup(void) {}
void loop(void) {}

If I'll uncomment
Code:
// #include <TimeLib.h>
the error is gone, but I need <TimeLib.h>

Can anyone help me ?
 
struct tm is NOT defined in "Time.h" (TD lib) but in <time.h> (system lib)
Time.h is called from TimeLib.h
unfortunately windows in case insensitive so struct tm is not reachable. solution: copy declaration of struct tm into your sketch.
 
Back
Top