【发布时间】:2016-03-28 02:00:23
【问题描述】:
不久前我正在编写一些东西......一切都很顺利,直到编译器给我这个错误:
C:\Users\presgiovanni\workspace\verbaleesami\Debug/../persona.h:24: riferimento non definito a "vtable for Persona"
main.o: nella funzione "ZN7PersonaD2Ev":
C:\Users\presgiovanni\workspace\verbaleesami\Debug/../persona.h:25: riferimento non definito a "vtable for Persona"
collect2.exe: error: ld returned 1 exit status
(对不起,它是意大利语的,你知道的...它说“未定义对 Persona 的 vtable 的引用”)
这是感兴趣的头文件的代码(行用“>>”表示):
#ifndef PERSONA_H_
#define PERSONA_H_
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
using std::ostream;
using std::istream;
#include <string>
using std::string;
class Persona{
public:
>> Persona(){;}
>> virtual ~Persona() = default;
virtual bool login(istream&);
virtual ostream& print(ostream&);
protected:
string nome, cognome, nickname, password;
};
#endif /* PERSONA_H_ */
谁能解释一下发生了什么(我正在使用 Eclipse)?谢谢!
【问题讨论】: