Somewhat new to c++, attempting to create classes/functions to make my future code clean. I am using Code::Blocks to create my program and at the moment receiving the above message for the following cpp and header files for disctype, ripmusic and dvdmanip. The compiler is gcc and this is not the main program.
The header file:
#ifndef MUSIC_H
#define MUSIC_H
using namespace std;
class media
{
public:
media();
virtual ~media();
protected:
string detectdisc;
private:
};
class disctype: public media
{
public:
disctype();
};
class ripmusic: public media
{
public:
ripmusic();
};
class dvdmanip: public media
{
public:
dvdmanip();
};
#endif // MUSIC_H
The cpp file:
#include "media.h"
//using namespace std;
media::media()
{
//ctor
}
media::~media()
{
//dtor
}
void media::disctype()
{
do
detectdisc= system(cdde -b)
while detectdisc != ""
if (detectdisc == "An audio cd was inserted.")
{
ripmusic();
}
else if (detectdisc == "A dvd was inserted.")
{
dvdmanip();
}
}
void media::ripmusic()
{
musicrip.hidden=false
}
void media::dvdmanip()
{
//musicrip.hidden=false
}
The error messages tells you that you don't have the specified member methods in media (particulary
media
does not contain the membersripmusic(), dvdmanip() and
disctype()` which you try to define later. You member definitions need to be changed to: