急需解决error LNK2001: unresolved external symbol "public: __thiscall Employee:
#include<iostream>#include<string>
# define N 3
using namespace std;
class Employee
{public:
Employee();
Employee(int n,char s,string nam,string da,string p)
{
num=n;
sex=s;
name=nam;
date=da;
position=p;
}
void set_1();
void display();
private:
int num;
char sex;
string name;
string date;
string position;
};
void Employee::set_1()
{
cin>>num>>sex>>name>>date>>position;
}
void Employee::display()
{
cout<<num<<sex<<name<<date<<position<<endl;
}
int main(void)
{
class Employee emp[N];
cout<<"please enter the information"<<endl;
for(int i=0;i<N;i++)
emp[i].set_1();
for(int k=0;k<N;k++)
emp[i].display();
return 0;
}
error LNK2001: unresolved external symbol "public: __thiscall Employee::Employee(void)" (??0Employee@@QAE@XZ)
Debug/1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
1.exe - 2 error(s), 0 warning(s)