fbiego / ESP32Time

An Arduino library for setting and retrieving internal RTC time on ESP32 boards
MIT License
212 stars 36 forks source link

Example does not compile #15

Closed theotherjenkutler closed 2 years ago

theotherjenkutler commented 2 years ago

Hi, working on Arduino 2.0.2 and also tested on 1.8.13 with DOIT ESP32 DEVKIT V1 and neither one will compile. The errors given are:

/private/var/folders/3_/4_8k54812bv0gy6p0pr0dtc40000gn/T/.arduinoIDE-unsaved20211123-3498-ef7n86.rw7fw/esp32_time/esp32_time.ino:70:13: error: variable 'tm timeinfo' has initializer but incomplete type struct tm timeinfo = rtc.getTimeStruct();

/private/var/folders/3_/4_8k54812bv0gy6p0pr0dtc40000gn/T/.arduinoIDE-unsaved20211123-3498-ef7n86.rw7fw/esp32_time/esp32_time.ino:70:42: error: invalid use of incomplete type 'struct tm' struct tm timeinfo = rtc.getTimeStruct();

/Library/Arduino15/packages/esp32/hardware/esp32/2.0.2/cores/esp32/Print.h:94:25: note: forward declaration of 'struct tm' size_t print(struct tm timeinfo, const char format = NULL);

Thanks!

fbiego commented 2 years ago

add this at the top

include "time.h"

11