Dodgy DS3231 library? ‘DS3231 clock’ redeclared

I thought I might throw this into the mix...
My DS3231 alarm programme refused to compile. The error was
DS3231 clock’ redeclared as different kind of symbol DS3231 clock;
I have never used an RTC library before and I'm still not sure I need one, but was very careful to have the recommended, and only the recommended one installed. The library is by Andrew Wickert, no examples included therein, and the programme is by David Sparks.
This matter has come up before but in a closed thread.
The problem can be fixed by changing every instance of "clock" to "RTC"

1 Like

Please post a link to the closed topic

Can you post the code?

@Helibob

@er_name

I have not yet proven the code works but it does now compile. Using "RTC" instead of "clock1" might not be such a good idea, as there are nother references to RTC, so I am now using "clock1" as shown in the thread.

As I said, I'm not sure this is all necessary, but using a library may make it easier to code for setting and synchronising the time and setting the alarm. I am following Sparks's programme as it seems to deal in seconds for the alarm, which is the accuracy I need.

Is there a question here?

It seems like the 'link' had the solution to the compile error.

:smiley_cat:

Well, one question is "How the hell can this happen?"

Did Sparks test before he published?
Did the guy in Iowa?
Is the problem in the library or the code?

There may be other questions, I'm actually just fishing for some learned comment.

If you use a pre defined type then you will get an error when you redefine it...


I don't know who 'typedef' it previously ... doubt it was the library...


What kind of answer/resolution are you after?

It appears to be working or at least compiling...

:smiley_cat:

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