Error Compiling DCF77 Example

Hey there,

I’m trying to compile the Example Sketch InternalClockSync from the DCF77 library but it’s giving me this Error:

exit status 1
'time_t time' redeclared as different kind of symbol

And above I see that day month and so on wasn’t declared. Any hints on this? Seems for me like any librarys are missing but i think I included all. (DCF77,Time, Timezone).

Full Error attached.

Christopher

Errors.txt (9.89 KB)

Change the line:

#include <Time.h>

to:

#include <TimeLib.h>

I have already submitted a fix for this issue to the repository for that library: https://github.com/thijse/Arduino-DCF77/pull/3

Hmm, the Errors are getting less :wink:

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -hardware "C:\Users\Christopher\AppData\Local\Arduino15\packages" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -tools "C:\Users\Christopher\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Christopher\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10609 -build-path "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\CHRIST~1\AppData\Local\Temp\arduino_modified_sketch_118968\InternalClockSync.pde"
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware "C:\Program Files (x86)\Arduino\hardware" -hardware "C:\Users\Christopher\AppData\Local\Arduino15\packages" -tools "C:\Program Files (x86)\Arduino\tools-builder" -tools "C:\Program Files (x86)\Arduino\hardware\tools\avr" -tools "C:\Users\Christopher\AppData\Local\Arduino15\packages" -built-in-libraries "C:\Program Files (x86)\Arduino\libraries" -libraries "C:\Users\Christopher\Documents\Arduino\libraries" -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10609 -build-path "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp" -warnings=all -prefs=build.warn_data_percentage=75 -verbose "C:\Users\CHRIST~1\AppData\Local\Temp\arduino_modified_sketch_118968\InternalClockSync.pde"
Warning: Board arduino:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB
WARNING: Spurious .github folder in 'Adafruit NeoPixel' library
"C:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\cores\arduino" "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\variants\standard" "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp\sketch\InternalClockSync.pde.cpp" -o "nul"
"C:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\cores\arduino" "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\variants\standard" "-IC:\Users\Christopher\Documents\Arduino\libraries\DCF77" "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp\sketch\InternalClockSync.pde.cpp" -o "nul"
"C:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10609 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\cores\arduino" "-IC:\Users\Christopher\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.12\variants\standard" "-IC:\Users\Christopher\Documents\Arduino\libraries\DCF77" "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp\sketch\InternalClockSync.pde.cpp" -o "C:\Users\CHRIST~1\AppData\Local\Temp\buildd68eee4b77e692d8c26f324b916707ea.tmp\preproc\ctags_target_for_gcc_minus_e.cpp"
C:\Users\CHRIST~1\AppData\Local\Temp\arduino_modified_sketch_118968\InternalClockSync.pde:23:21: fatal error: TimeLib.h: No such file or directory

 #include "TimeLib.h"

                     ^

compilation terminated.

Using library DCF77 at version 1.0.0 in folder: C:\Users\Christopher\Documents\Arduino\libraries\DCF77 
exit status 1
Error compiling for board Arduino/Genuino Uno.

Do I have to rename the Folder too?

You must have an old version of the Time library installed. Try this:

  • Sketch > Include Library > Manage Libraries... > Type: Updatable
  • scroll down until you find the one that says "Time by Michael Margolis"
  • Click the "Update" button
  • Click the "Close" button
  • Try compiling the sketch again

Worked. Thanks :grinning: