udoklein / dcf77

Noise resilient DCF77 decoder library for Arduino
http://blog.blinkenlight.net/experiments/dcf77/dcf77-library/
GNU General Public License v3.0
91 stars 28 forks source link

Compiler error in examples The_Clock and Simple_Clock #15

Closed domhardt closed 8 years ago

domhardt commented 8 years ago

_SimpleClock

Simple_Clock.ino: In function 'void setup()':
Simple_Clock.ino:59:21: error: 'Clock' is not a namespace-name
Simple_Clock.ino:59:26: error: expected namespace-name before ';' token
Simple_Clock.ino:89:26: error: 'Clock' has not been declared
Simple_Clock.ino:90:18: error: 'Clock' has not been declared
Simple_Clock.ino:90:45: error: 'Clock' has not been declared
Simple_Clock.ino:94:9: error: 'Clock' has not been declared
Simple_Clock.ino:94:23: error: expected ';' before 'now'
Simple_Clock.ino:95:39: error: 'now' was not declared in this scope
Simple_Clock.ino: In function 'void loop()':
Simple_Clock.ino:114:5: error: 'Clock' has not been declared
Simple_Clock.ino:114:19: error: expected ';' before 'now'
Simple_Clock.ino:116:35: error: 'now' was not declared in this scope
Simple_Clock.ino:119:18: error: 'Clock' has not been declared
Simple_Clock.ino:120:18: error: 'Clock' has not been declared
Simple_Clock.ino:121:18: error: 'Clock' has not been declared
Simple_Clock.ino:122:18: error: 'Clock' has not been declared

_TheClock

The_Clock.ino:91:31: error: 'Clock' does not name a type
The_Clock.ino:91:45: error: expected unqualified-id before '&' token
The_Clock.ino:91:45: error: expected ')' before '&' token
The_Clock.ino:91:46: error: expected initializer before 'decoded_time'
The_Clock.ino: In function 'void MaxTicks::setup()':
The_Clock.ino:120:41: error: 'output_handler' was not declared in this scope
The_Clock.ino: At global scope:
The_Clock.ino:125:31: error: 'Clock' does not name a type
The_Clock.ino:125:45: error: expected unqualified-id before '&' token
The_Clock.ino:125:45: error: expected ')' before '&' token
The_Clock.ino:125:46: error: expected initializer before 'decoded_time'
The_Clock.ino: In function 'void Ticks::setup()':
The_Clock.ino:150:41: error: 'output_handler' was not declared in this scope
The_Clock.ino: At global scope:
The_Clock.ino:155:31: error: 'Clock' does not name a type
The_Clock.ino:155:45: error: expected unqualified-id before '&' token
The_Clock.ino:155:45: error: expected ')' before '&' token
The_Clock.ino:155:46: error: expected initializer before 'decoded_time'
The_Clock.ino:385:1: error: expected '}' at end of input

EDIT IDE information: Arduino 1.6.0 from arduino.cc

EDIT2 added markdown for code sections

domhardt commented 8 years ago

New try with IDE Arduino 1.6.6 from arduino.cc leads to same problems. DCF77_Scope is working.

Arduino: 1.6.6 (Mac OS X), Board: "Arduino/Genuino Uno"

/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/michaeldomhardt/Documents/Arduino/libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino"
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware "/Applications/Arduino.app/Contents/Java/hardware" -tools "/Applications/Arduino.app/Contents/Java/tools-builder" -tools "/Applications/Arduino.app/Contents/Java/hardware/tools/avr" -built-in-libraries "/Applications/Arduino.app/Contents/Java/libraries" -libraries "/Users/michaeldomhardt/Documents/Arduino/libraries" -fqbn=arduino:avr:uno -ide-version=10606 -build-path "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp" -warnings=none -prefs=build.warn_data_percentage=75 -verbose "/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein/dcf77.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -M -MG -MP -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics  -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/preproc/ctags_target.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino2/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/preproc/ctags_target.cpp"
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10606 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR   "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "-I/Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein" "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp" -o "/var/folders/8z/tb7k5_xx3y1b_b99mj7h08dc0000gn/T/build3342978b5fc7ef8a94d607cb5554483f.tmp/sketch/The_Clock.ino.cpp.o"
The_Clock:56: error: 'Clock' does not name a type
     }
                           ^
The_Clock:56: error: expected unqualified-id before '&' token
     }
                                         ^
The_Clock:56: error: expected ')' before '&' token
The_Clock:56: error: expected initializer before 'decoded_time'
     }
                                          ^
The_Clock:57: error: 'namespaceHours_and_Minutes' does not name a type
 }
 ^
The_Clock:91: error: 'Clock' does not name a type
     void output_handler(const Clock::time_t &decoded_time) {
                               ^
The_Clock:91: error: expected unqualified-id before '&' token
     void output_handler(const Clock::time_t &decoded_time) {
                                             ^
The_Clock:91: error: expected ')' before '&' token
The_Clock:91: error: expected initializer before 'decoded_time'
     void output_handler(const Clock::time_t &decoded_time) {
                                              ^
/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino: In function 'void MaxTicks::setup()':
The_Clock:120: error: 'output_handler' was not declared in this scope
         DCF77_Clock::set_output_handler(output_handler);
                                         ^
/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino: At global scope:
The_Clock:125: error: 'Clock' does not name a type
     void output_handler(const Clock::time_t &decoded_time) {
                               ^
The_Clock:125: error: expected unqualified-id before '&' token
     void output_handler(const Clock::time_t &decoded_time) {
                                             ^
The_Clock:125: error: expected ')' before '&' token
The_Clock:125: error: expected initializer before 'decoded_time'
     void output_handler(const Clock::time_t &decoded_time) {
                                              ^
/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino: In function 'void Ticks::setup()':
The_Clock:150: error: 'output_handler' was not declared in this scope
         DCF77_Clock::set_output_handler(output_handler);
                                         ^
/Users/michaeldomhardt/Documents/Arduino/dcf77-udoklein/examples/The_Clock/The_Clock.ino: At global scope:
The_Clock:155: error: 'Clock' does not name a type
     void output_handler(const Clock::time_t &decoded_time) {
                               ^
The_Clock:155: error: expected unqualified-id before '&' token
     void output_handler(const Clock::time_t &decoded_time) {
                                             ^
The_Clock:155: error: expected ')' before '&' token
The_Clock:155: error: expected initializer before 'decoded_time'
     void output_handler(const Clock::time_t &decoded_time) {
                                              ^
The_Clock:385: error: expected '}' at end of input
 }
 ^
Bibliothek dcf77-udoklein im Ordner: /Users/michaeldomhardt/Documents/Arduino/libraries/dcf77-udoklein (legacy) wird verwendet
exit status 1
'Clock' does not name a type
udoklein commented 8 years ago

The compiler complains that namespace "Clock" is missing. However in dcf77.h this namespace is declared. So either you modified my code or you are compiling new examples vs. an outdated version of my library.

nospam2000 commented 8 years ago

Are your sure you have only one copy of dcf77.h in your Arduino library subdirectories? I'm not sure about the recent changes in Arduino, but in former times the 'main' header file had to be named the same as library folder. Unfortunately there are multiple dcf77 libraries which use a header called dcf77.h. This is why I renamed Udo's dcf77.h to dcf77uk.h in my local installation, so I have dcf77/dcf77.h and dcf77uk/dcf77uk.h unfortunately I also had to change all references.

domhardt commented 8 years ago

Hi again,

the dcf77 library in my installation was indeed outdated. So the example from a new pull won't compile. It's working now. Thanks for the hint and sorry for the noise.

Regards, Michael

udoklein commented 8 years ago

Never mind. In case you feel you want to improve your karma: http://blog.blinkenlight.net/good-karma/ ;)