This question already has an answer here:
- c++ undefined reference to vtable 6 answers
I am getting an undefined reference to `vtable for student' while compiling the following header file:
student.h
class student
{
private:
string names;
string address;
string type;
protected:
float marks;
int credits;
public:
student();
student(string n,string a,string t,float m);
~student();
string getNames();
string getAddress();
string getType();
float getMarks();
virtual void calculateCredits();
int getCredits();
};
student::student(){}
student::student(string n, string a,string t,float m)
{
names = n;
address = a;
marks = m;
}
student::~student(){}
I can't find what is wrong in this.