qq_28015407 2015-05-07 12:15 采纳率: 0%
浏览 1817

error LNK2019: 无法解析的外部符号 (新手求助)

程序如下:

 #include "stdafx.h"
#include "iostream"
#include "string"
#include "targetver.h"
 using namespace std;

 //////////////////////////////////////////////////////////////////////////基类
 class person
 {
 public:
     string no;
     string name;
     person(string i,string j){ no=i;name=j;}
     person();
     ~person();
 };
 person::~person(){}
 /////////////////////////////////////////////////////////////////////////学生派生
 class student :private person
 {
private:
     int Cno;
     float score;
 public:
     student (string n,string na,int cn,float s );
     student();
     void s_cin(student &s);
     void display()
     {
      cout<<"编号:"<< no<<endl;
      cout<<"姓名:"<< name<<endl;
      cout<<"班号:"<< Cno<<endl;
      cout<<"成绩:"<< score<<endl;
     }
     ~student();
 };
 /////////////////////////////////////////////////////////////////////////教师派生类
  class teacher :private person
 {
private:
     string wname;
     string wage;
 public:
     teacher (string n,string na,string wn,string wa );
     teacher();
     void t_cin(teacher &t);
     void display()
     {
      cout<<"编号:"<< no<<endl;
      cout<<"姓名:"<< name<<endl;
      cout<<"职称:"<< wname<<endl;
      cout<<"部门:"<< wage<<endl;
     }
     ~teacher();
 };
  /////////////////////////////////////////////////////////////////////////
  student::student (string n,string na,int cn,float s ):person(n,na)
  {
      Cno=cn;
      score=s;
  }

  void student::s_cin(student &s)
  {
    cout<<"输入学生信息:"<<endl;
    cin>>s.no>>s.name>>s.Cno>>s.score;
  }
  student::~student(){}
  //////////////////////////////////////////////////////////////////////////
   teacher ::teacher(string n,string na,string wn,string wa ):person(n,na)
   {
       wname=wn;
       wage=wa;
   }

void teacher::t_cin(teacher &t)
  {
    cout<<"输入学生信息:"<<endl;
    cin>>t.no>>t.name>>t.wname>>t.wage;
  }
teacher::~teacher(){}
/////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
    teacher t;
    student s;
    s.s_cin(s);
    t.t_cin(t);
    s.display();
    t.display();
    return 0;
}在这里书写代码片  
  • 写回答

3条回答 默认 最新

  • oyljerry 2015-05-07 14:13
    关注

    是不是没有包含对应的lib库文件。

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!