DCF77 library geeft compilatiefout

Ik ben nieuw op dit forum.
Ik werk al enige tijd met de DCF77 bibliotheek van Thijs Elenbaas tot grote tevredenheid. Echter van de ene op de andere dag is compileren onmogelijk.

Mijn programma is:

#include <DCF77.h>

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

Compileren geeft als resultaat:


C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::int0handler()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:102:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("rCT");
              ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:109:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      LogLn("rPW");
                 ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::appendSignal(unsigned char)':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:146:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("EoB");
              ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static void DCF77::finalizeBuffer()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:157:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("BF");
             ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:160:21: error: 'now' was not declared in this scope
   filledTimestamp = now();
                     ^~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:160:21: note: suggested alternative: 'pow'
   filledTimestamp = now();
                     ^~~
                     pow
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:166:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("EoM");
              ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::receivedTimeUpdate()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:183:25: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("Invalid parity");
                         ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:189:46: error: 'now' was not declared in this scope
  time_t processedTime = latestupdatedTime + (now() - processingTimestamp);
                                              ^~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:189:46: note: suggested alternative: 'pow'
  time_t processedTime = latestupdatedTime + (now() - processingTimestamp);
                                              ^~~
                                              pow
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:191:33: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("Time outside of bounds");
                                 ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:197:20: error: 'SECS_PER_MIN' was not declared in this scope
  if(difference < 2*SECS_PER_MIN) {
                    ^~~~~~~~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:197:20: note: suggested alternative: 'WCHAR_MIN'
  if(difference < 2*SECS_PER_MIN) {
                    ^~~~~~~~~~~~
                    WCHAR_MIN
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:198:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("close to internal clock");
                                  ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:209:25: error: 'SECS_PER_MIN' was not declared in this scope
  if(shiftDifference < 2*SECS_PER_MIN) {
                         ^~~~~~~~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:209:25: note: suggested alternative: 'WCHAR_MIN'
  if(shiftDifference < 2*SECS_PER_MIN) {
                         ^~~~~~~~~~~~
                         WCHAR_MIN
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:210:30: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("time lag consistent");
                              ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:213:32: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   LogLn("time lag inconsistent");
                                ^
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static bool DCF77::processBuffer()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:271:2: error: 'tmElements_t' was not declared in this scope
  tmElements_t time;
  ^~~~~~~~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:284:12: error: request for member 'Second' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
       time.Second = 0;
            ^~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:285:9: error: request for member 'Minute' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
    time.Minute = rx_buffer->Min-((rx_buffer->Min/16)*6);
         ^~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:286:12: error: request for member 'Hour' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
       time.Hour   = rx_buffer->Hour-((rx_buffer->Hour/16)*6);
            ^~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:287:12: error: request for member 'Day' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
       time.Day    = rx_buffer->Day-((rx_buffer->Day/16)*6);
            ^~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:288:12: error: request for member 'Month' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
       time.Month  = rx_buffer->Month-((rx_buffer->Month/16)*6);
            ^~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:289:12: error: request for member 'Year' in 'time', which is of non-class type 'time_t(time_t*) {aka long unsigned int(long unsigned int*)}'
       time.Year   = 2000 + rx_buffer->Year-((rx_buffer->Year/16)*6) -1970;
            ^~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:290:24: error: 'makeTime' was not declared in this scope
    latestupdatedTime = makeTime(time);
                        ^~~~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:290:24: note: suggested alternative: 'mktime'
    latestupdatedTime = makeTime(time);
                        ^~~~~~~~
                        mktime
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getTime()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:310:44: error: 'now' was not declared in this scope
   time_t currentTime =latestupdatedTime + (now() - processingTimestamp);
                                            ^~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:310:44: note: suggested alternative: 'pow'
   time_t currentTime =latestupdatedTime + (now() - processingTimestamp);
                                            ^~~
                                            pow
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp: In static member function 'static time_t DCF77::getUTCTime()':
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:325:42: error: 'SECS_PER_HOUR' was not declared in this scope
   int UTCTimeDifference = (CEST ? 2 : 1)*SECS_PER_HOUR;
                                          ^~~~~~~~~~~~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:326:64: error: 'now' was not declared in this scope
   time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp);
                                                                ^~~
C:\Users\w van schellen\Documents\Arduino\libraries\DCF77\DCF77.cpp:326:64: note: suggested alternative: 'pow'
   time_t currentTime =latestupdatedTime - UTCTimeDifference + (now() - processingTimestamp);
                                                                ^~~
                                                                pow
exit status 1
Fout bij het compileren voor board Arduino Uno

Ook als ik compileer op een Mega is het resultaat hetzelfde.

Wie heeft enig idee in welke hoek is de oorzaak moet zoeken?

Ik draai op Windows10
Arduino 1.8.19

Geen ervaring met de DCF77 library. Hoewel ik een andere foutmelding had verwacht moet ik toch even vragen of je de TimeLib geinstalleerd hebt?

Ik heb de DCF77 library gedownload and een voorbeeld gepakt en het geeft geen fouten bij het compileren.

de eerste fout is dat jouw compiler het woordje now niet kent, dus kijk in de library of die daar wel instaat. meestal is dat omdat er een andere library gebruikt wordt, dus zeker weten dat je de goede aan hebt staan, bij mij gebeurt het vaak dat er een andere als eerste gepakt wordt. je krijgt een melding tijdens compileren als er twee libs staan met dezelfde naam.

TimeLib heb ik tijden geleden al geïnstalleerd omdat ik toen al een foutmelding kreeg, omdat time_t niet herkend werd.

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