I have a number of objects, all of which have constructors that take no parameters. I defined the simple constructor of the base class, and I have not defined the others. When compiling, I receive an "Undeclared reference to constructor" error for each class, but I get an even more confusing error if I try to define the derived objects' constructors. The following is the "weird" error:
CMakeFiles/project4.dir/src/Strategy.cpp.o: In function `ForwardStrategy':
/home/ics45c/projects/p4/src/Strategy.cpp:42: undefined reference to `vtable for
ForwardStrategy'
My constructor for the base class looks like this:
ForwardStrategy::ForwardStrategy()
{
}
And all other constructors look like this (each with different numbers):
ForwardStrategy1::ForwardStrategy1()
{
}
Any help is greatly appreciated!
Edit: Here is the class declaration:
class ForwardStrategy
{
public:
ForwardStrategy();
virtual ~ForwardStrategy() = default;
virtual bool isWorthForwarding(Message::Message* m) = 0;
virtual void setType(unsigned int type);
virtual void setQuality(unsigned int q);
private:
unsigned int type;
unsigned int quality;
};