RTCLib Suddenly won't compile

Tweaking some code today and suddenly the RTCLib won't compile . Compiling for ESP32-WROOM board. Getting this error message: C:\Users\xxx\Documents\Arduino\libraries\RTClib\src/RTClib.h:31:25: error: expected unqualified-id before numeric constant #define SECONDS_PER_DAY 86400L ///< 60 * 60 * 24

Since I had just loaded latest version (2.0xx) I tried rolling back to last 1.xxx version, but still got same error. Worked yesterday. What's up with that?

post your code and the full error message?

Have you saved your code, closed ALL the instances of the IDE & reopened & tried?

Try with one example code of the library

Versions of what?

a7

I assumed of the IDE

RTClib 2.0.2 (latest)
Tried datecalc.ino example on Wokwi with ESP32, compiled and ran fine.

Do a pre-cleanup prior to library installation...

  • Delete this folder: C:\Users\xxx\Documents\Arduino\libraries\RTClib
  • Clean cache
  • Re-start PC then install RTClib using [Tools] [Manage Libraries...]

Re: #include "RTClib.h" ← this format is used in the library, not #include <RTClib.h>
Do you have a local version that's interfering with or replacing the installed version?

Thanks for the inputs. Now realize I was too quick to post as I was a bit frustrated at the time. Now believe the problem must be a collision between the RTCLib library and the NeoGPS library. My first thought was the latest RTCLib update was the culprit, but rolling back to an earlier version had no impact. The NeoGPS library is very big, so it will take some time to search for conflicts. Since the problem is specific and unlikely to be useful to all but a few members of the community, I won't waste any more of your time unless someone has a specific need for resolution.

Thanks again for the interest and willingness to help.

This was easier to resolve than I feared. Did word search for "SECONDS_PER_DAY" on both library folders and found both were using this variable name. Changed the RTCLib variable to SECONDS_PER_DAY_1, saved it and compiler was fine with the change.

No, the RTCLib. I had just updated it to latest when I encountered the problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.