I’m getting a linker error in xcode and I’m having a hard time understanding and finding the problem. This is the error I’m getting:

My Instrument class looks like this:
class Instrument {
private:
public:
virtual float getSample(Note ¬e);
Instrument(){}
};
And it’s implemented by my Synth class:
class Synth : public Instrument{
private:
Volume volume;
public:
Synth(){}
void setVolume(float aVolume);
virtual float getSample(Note ¬e);
};
And I’m using Instrument as a member in my Track class:
class Track {
public:
bool muted;
Instrument instrument;
Track(){
this->muted = false;
}
};
Any ideas what is causing the problem? And I have one more question: If have a Track object, what is the best way to initialize it’s instrument member as a Synth? Would this work?
Track track;
track.instrument = Synth();
As Note in error says, you need to provide definition of virtual function which is missing I guess :
Instrument::getSample(Note ¬e);but I guess you need pure virtual function, make it:
if that’s not the case , post more code and check your code on different compiler , might be your compiler is buggy