error LNK2001: unresolved external symbol "public: __thiscall Book::~Book(void)"
/*三、以下是图书类book的定义,但没有类的实现部分的代码,请根据类的定义编写类的实现部分的代码,并编写响应的程序对所定义的类进行测试。
Class book
{
char *name; //书名
Char *author; //作者
Int sale; //销售量
Public
Book( ); //无参构造函数
Book(char,char,int); //有参构造函数
Void disp( ) //输出数据
~book( ); //析构函数
}
*/
#include<iostream>
#include<string.h>
using namespace std;
class Book
{
public:
Book(){name="c_plus_plus",author="T_H_Q",sale=60000;};
Book(string name1,string author1,int sale1):name(name1),
author(author1),sale(sale1){;};
string get_name(){return name;};
string get_author(){return author;};
int get_sale(){return sale;};
void display();
~Book();
private:
string name;
string author;
int sale;
};
void Book::display()
{
cout <<"name:";get_name();cout <<"\n";
cout <<"author:";get_author();cout <<"\n";
cout <<"sales:";get_sale();cout<<"\n";
};
int main()
{
Book book1;
Book book2("math","H_S_Q",70000);
book1.display();
book2.display();
return 0;
}
错误:Linking...
作业3.obj : error LNK2001: unresolved external symbol "public: __thiscall Book::~Book(void)" (??1Book@@QAE@XZ)
Debug/作业3.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
新手,不用讲得太高深,应该怎么改,谢谢了。
相关推荐
解决error LNK2001: unresolved external symbol
解决error LNK2001: unresolved external symbol
vc报error LNK2001unresolved external symbol的解决方法
解决报错Error LNK2001:unresolved external symbol
报error LNK2001 unresolved external symbol错就是因为你...
visual c++报error LNK2001 unresolved external symbol错就是因为你...
提示出现unresolved external symbol _main的解决方法
提示出现unresolved external symbol _main搜了下找了下原因如下在创建MFC项目时, 不使用MFC AppWizard向导, 如果没有设置好项目参数, 就会在编译时产生很多连接错误, 如error LNK2001错误, 典型的错误提示有: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 msvcrtd.lib(crt
关于VC6.0中 运行错误 unresolved external symbol _WinMain@16的解决
关于VC6.0中 运行错误 unresolved external symbol _WinMain@16的解决



