First problem:
undefined reference to `CD::getPrice()'
Your definition of this function does not qualify CD:: ; therefore, it instead declares and defines a function that is not a member.
double CD::getPrice() {
Similarly for CD::setPrice .
The second problem:
undefined reference to `typeinfo for MusicProduct'
Presumably, MusicProduct should be an abstract class, and you don't want to provide definitions for your virtual functions. In this case, you should declare them pure virtual:
virtual double getPrice() = 0;
If it should not be abstract, you need to implement these functions.
The third problem:
In member function 'virtual bool MusicStore::hasProduct( Product)': warning: no return statement in function returning non-void [-Wreturn-type]
Presumably, you have a function called MusicStore::hasProduct , which should return a boolean value, but it does not.
source share