My Arduinoish code. I turned on verbose compilation to check if all .o files were really transferred to the linker, and they are (link below). It makes me think this is some kind of syntax error.
Google for the error "undefined function reference" gives a lot of results with answers like "add foo.o to your linker command like this" etc.
I hope the solution will be as simple as a missing point or → somewhere.
I get this series of errors in a single file from the linker:
SerialServoControl.cpp.o: In function `SerialServoControl::send(int, int)': SerialServoControl.cpp:31: undefined reference to `SerialServoControl::_serial' SerialServoControl.cpp:31: undefined reference to `SerialServoControl::_serial' SerialServoControl.cpp.o: In function `SerialServoControl::init(char, char)': SerialServoControl.cpp:9: undefined reference to `SerialServoControl::_tx' SerialServoControl.cpp:10: undefined reference to `SerialServoControl::_rx'
.H file:
#ifndef SERIALSERVOCONTROL_H #define SERIALSERVOCONTROL_H #include "NewSoftSerial.h" class SerialServoControl { public:
and .cpp file:
#ifndef SERIALSERVOCONTROL_CPP #define SERIALSERVOCONTROL_CPP #include "WProgram.h" #include "SerialServoControl.h"
Linker command (I removed the explicit temporary directory paths that the IDE generates for clarity and split them into several lines. The actual command is not specified with respect to the location of all these files):
avr-gcc -Os -Wl,
All these files (SerialServoControl, Wheel_Chair_Joystick, NewSoftSerial, WheelChairMotor) exist in the Arduino sketch directory. Core.a is a compiled AVR library.
source share