RTCZero icon indicating copy to clipboard operation
RTCZero copied to clipboard

Using RTCZero and TimeLib.h doesn't compile

Open dIoTte opened this issue 8 years ago • 7 comments
trafficstars

Any idea why it is not possible to use both libraries at the same time?

#include <TimeLib.h> #include <RTCZero.h> void setup() { } void loop() { }

dIoTte avatar Feb 27 '17 23:02 dIoTte

Hi @dIoTte,

This is because TimeLib.h contains a file named Time.h which on case insensitive filesystems (used by default on Mac and Windows) conflicts with the POSIX time.h header the RTCZero library uses.

We could ask the TimeLib maintainers to rename the Time.h file via a pull request. @facchinm @cmaglie what do you think?

sandeepmistry avatar Mar 01 '17 22:03 sandeepmistry

@sandeepmistry totally agree, but we should think about some sort of wrapper to avoid troubles for someone who includes Time.h

facchinm avatar Mar 02 '17 09:03 facchinm

Hello everyone, is it still in the plan to fix this problem?

Thanks, Seb

2017-03-02 4:18 GMT-05:00 Martino Facchin [email protected]:

@sandeepmistry https://github.com/sandeepmistry totally agree, but we should think about some sort of wrapper to avoid troubles for someone who includes Time.h

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arduino-libraries/RTCZero/issues/28#issuecomment-283599655, or mute the thread https://github.com/notifications/unsubscribe-auth/AY3aCpILklH0SxHL2z8H6EfQqHxzaBCEks5rholbgaJpZM4MNwme .

dIoTte avatar May 08 '17 01:05 dIoTte

@dIoTte I've opened to following issue to continue the discussion https://github.com/PaulStoffregen/Time/issues/74

sandeepmistry avatar May 10 '17 19:05 sandeepmistry

Hi @dIoTte,

Based on the discussion in https://github.com/PaulStoffregen/Time/issues/74#issuecomment-300629882, @PaulStoffregen is not keen on removing Time.h from the TimeLib library for compatibility with older IDE versions.

As a work around, we would suggest you manually remove Time.h from <SKETCHBOOK>/libraries/Time/ if you wish to use both TimeLib and RTCZero in your sketch.

cc/ @cmaglie

sandeepmistry avatar May 11 '17 18:05 sandeepmistry

Sorry, I´ve a problema with this library. When I use GMT-3 setup, the library Works well… but near mitnight, returns wrong day and time. Could you help me please. Thanks a lot

DiegoD4i avatar Mar 16 '19 00:03 DiegoD4i

I have the same problem. So the solution is to manually remove Time.h from <SKETCHBOOK>/libraries/Time/?

thewoz avatar Jun 22 '20 14:06 thewoz