undefined reference to 'vtable for classname'
本问题已经有最佳答案,请猛点这里访问。
Possible Duplicate:
Undefined reference to vtable
我有一个学生在档案上-学生。这是它的构造器:
1 2 3 4 5 6 7 8 9 10 11 12 | class Student { protected: double _id; double _salary; double _grade_average; public: Student(double id, double salary,double average): _id(id),_salary(salary),_grade_average(average) {} }; |
然后我得到错误:
undefined reference to 'vtable for Student'
有什么问题?
这是一个大学.h文件:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include"Student.h" class University : public Student { public: virtual double getValue(); University(char university_id,double id, double average,double salary): _university_id(university_id),Student(id,average,salary) { } private: char _university_id; static double how_many; static double sum_avg_grades; }; |
一些事情。