Hello, I am currently coding a phoneme-based servo driver for my arduino Mega, which features a class called PhonemeBlock stored on its own .cpp and .h files. However, the project fails to compile, throwing this error:
Temp\cc3zkw9M.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_Animation.cpp.o.2214':<artificial>:(.text.startup+0x9a): undefined reference to `PhonemeBlock::PhonemeBlock()
This is confusing because I have 3 defined constructors for the PhonemeBlock class:
PhonemeBlock::PhonemeBlock(String x, float st, float et){
starttime = st;
endtime= et;
name = x;
id = phonemeID(x);
jogspeed = 200;
}
PhonemeBlock::PhonemeBlock(String x, float st, float et, int js){
starttime = st;
endtime= et;
name = x;
id = phonemeID(x);
jogspeed = js;
}
PhonemeBlock::PhonemeBlock(){
name = "M";
id = phonemeID(name);
jogspeed = 200;
starttime = 0.0;
endtime = 0.0;
}
The header file for this section looks like this:
#ifndef ANIMATION_H
#define ANIMATION_H
#include "Posing.h"
class PhonemeBlock{
public:
String name;
byte id;
float starttime;
float endtime;
int jogspeed;
PhonemeBlock();
PhonemeBlock(String x, float st, float et, int js);
PhonemeBlock(String x, float st, float et);
};
#endif
Is the compiler capable of overloading class definitions like this? If so, what's my mistake here?