Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESPNtpClient won't compile with TimeLib.h #17

Closed
morres83 opened this issue Mar 12, 2021 · 3 comments
Closed

ESPNtpClient won't compile with TimeLib.h #17

morres83 opened this issue Mar 12, 2021 · 3 comments

Comments

@morres83
Copy link

Hello, I am facing the following issue:
The ESPNtpClient doesn't compile on ESP32 as soon as the TimeLib.h (paulstoffregen/Time@^1.6) gets included. Unfortuneatly this library is a dependency of DS3232RTC.h which I also need. Without Time.h and TimeLib.h, there is no compiling error

Is there a workaround?

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:65:16: error: expected ')' before '(' token
constexpr auto SECS_PER_MIN = ((time_t)(60UL));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:66:16: error: expected ')' before '(' token
constexpr auto SECS_PER_HOUR = ((time_t)(3600UL));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:67:16: error: expected ')' before '(' token
constexpr auto SECS_PER_DAY = ((time_t)(SECS_PER_HOUR * 24UL));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:68:16: error: expected ')' before '(' token
constexpr auto DAYS_PER_WEEK = ((time_t)(7UL));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:69:16: error: expected ')' before '(' token
constexpr auto SECS_PER_WEEK = ((time_t)(SECS_PER_DAY * DAYS_PER_WEEK));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:70:16: error: expected ')' before '(' token
constexpr auto SECS_PER_YEAR = ((time_t)(SECS_PER_DAY * 365UL));

.pio/libdeps/nodemcu-32s/ESPNtpClient/src/ESPNtpClient.h:71:16: error: expected ')' before '(' token
constexpr auto SECS_YR_2000 = ((time_t)(946684800UL)); ///< @brief The time at the start of

@morres83
Copy link
Author

Actually the workaround is to just comment out these lines or wrap in into a
#ifndef SECS_PER_MIN
...
#endif

These items are already defined in Time.h as it seems.

@gmag11
Copy link
Owner

gmag11 commented Mar 14, 2021

That's a good solution. Would you add a pull request?

@gmag11
Copy link
Owner

gmag11 commented Mar 16, 2021

@gmag11 gmag11 closed this as completed Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants