I want to use my linux home server to update sketches of my home automation arduino, to ease testing. I use the Makefile method (make all upload) which works flawlessly for basic sketches. But my sketch has functions in the main file and the make process stops with a 'not declared in this scope' error, while it compiles fine in the standard IDE. I tried some of the examples and most work fine, until I take some with a function in it (Ping.pde). This gives:
/usr/bin/avr-g++ -MM -mmcu=atmega1280 -DF_CPU=16000000 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exceptions build-cli/Ping.cpp -MF build-cli/Ping.d -MT build-cli/Ping.o
cat build-cli/Ping.d > build-cli/depends.mk
/usr/bin/avr-g++ -c -mmcu=atmega1280 -DF_CPU=16000000 -I. -I/usr/share/arduino/hardware/arduino/cores/arduino -g -Os -w -Wall -ffunction-sections -fdata-sections -fno-exceptions build-cli/Ping.cpp -o build-cli/Ping.o
build-cli/Ping.cpp: In function 'void loop()':
build-cli/Ping.cpp:55: error: 'microsecondsToInches' was not declared in this scope
build-cli/Ping.cpp:56: error: 'microsecondsToCentimeters' was not declared in this scope
make: *** [build-cli/Ping.o] Error 1
Do I need to change anything in the Makefile or declare things in the pde?