Posted on 2010-08-16 22:19
傅先生 阅读(193)
评论(0) 编辑 收藏 引用
unresolved external symbol "public: __thiscall cat //错误
:#include <iostream>
using namespace std;
class cat
{ public:
cat(int age){itsage=age;}
~cat();
int getage()const {return itsage;}
private:
int itsage;
};
cat *makecat(int age);
int main()
{
int age=7;
cat * boots=makecat(age);
cout<<"boot is"<<boots->getage()<<"old"<<endl;
delete boots;
return 0;
}
cat *makecat(int age)
{ return new cat(age);
}
新手上路,大家帮我看看是哪里的问题。下面是显示的错误
error LNK2001: unresolved external symbol "public: __thiscall cat::~cat(void)" (??1cat@@QAE@XZ)
Debug/4.exe : fatal error LNK1120: 1 unresolved externals这里专家的回答会让您满意
~cat();
变成
~cat(){}