I am getting nuts with the Arduino at the moment and I don´t know how to fix it.
I can´t compile the example sketches for DCF77.
Always getting error "'time_t time' redeclared as different kind of symbol".
NO changes are made in the sketches.
I get the error on two machines
Version 1.6.8. and 1.6.10 - already deinstalled and reinstalled - fresh c:\user\documents\arduino folder
What Do I have to do?? :o
(maybe already fixed in another thread but I havent found it.
THANKS...
SteHoub
Full error text is: InternalClockSync:28: error: 'time_t time' redeclared as different kind of symbol time_t time;
^* In file included from C:\Users\User\Documents\Arduino\libraries\DCF77/DCF77.h:9:0,
DCF77_Test:2:21: error: TimeLib.h: No such file or directory
compilation terminated.
exit status 1
TimeLib.h: No such file or directory
Now of course I checked if there is such a Library for Download but I Couldn't find anything. Can Anyone Help?
Use the Library Manager in the IDE to find Time by Michael Margolis Version 1.5.0
Install that, and in the sketch use
#include <TimeLib.h>
This confusing situation was caused by a Windows issue about case sensitive file names where Time.h and time.h were seen as the same file. Bill Perry explains it this way here
Windows treats the filenames Time.h and time.h the same, even though they are not the same file so if there is a system file called time.h , which there is for some Arduino cores, then Windows will fail to build things correctly since it can grab time.h instead of Time.h which will cause problems since it is the wrong header file.
This is not really a problem with the library and it is not a problem for other operating systems that don't ignore the case of letters in filenames. It is a Windows problem in the way Windows handles filenames.
To work around this Windows issue, a file called TimeLib.h was created in the Time library.
So if you are using Windows, you will need to include TimeLib.h and not Time.h
Simple as that.
Also, using TimeLib.h will work for all the other operating systems that don't have this case issue.