My code is Arduinoish. I turned on verbose compiling so I could verify that all the .o files are indeed getting passed to the linker correctly, and they are (linker command
You have to define your class statics in a source file some where. Putting them in the class just declares that they are there, but something still needs to define them.
Inside your .cpp
file your can do so like this:
NewSoftSerial SerialServoControl::_serial(9, 8);
char SerialServoControl::_tx = 0;
char SerialServoControl::_rx = 0;
Put appropriate initial values; I just assumed the comment was for the constructor.
You need to create memory and initialize your static variables.
In your CPP file add the following:
NewSoftSerial SerialServoControl::_serial(9, 8);
char SerialServoControl::_tx = 0;
char SerialServoControl::_rx = 0;
Because the value _serial is static, it exists when an object isn't instantiated. This means that you must declare it in the code as
NewSoftSerial SerialServoControl::_serial(9, 8);
char SerialServoControl::_tx = 0;
char SerialServoControl::_rx = 0;
which has already been suggested.
If you then want to change it in the init function, you simply have to change your _serial = ...
line to SerialServoControl::_serial = NewSoftSerial(tx, rx).
Of course, this means you'll have to define a relevant constructor for the NewSoftSerial class.
Hope this helps.
I know this is somewhat dead, but in my case I forgot to define the methods I was referencing, imagine that.......
Yes they were DECLARED, but when I checked my .cpp file, there was no definition for them, so this time the error was literal.