类练习出现\main.cpp|8|undefined reference to `student::stuin()'问题怎么解决
main.cpp#include <iostream>
#include <string>
#include "student.h"
using namespace std;
int main()
{
student stu;
stu.stuin();
stu.stuout();
return 0;
}
student.cpp
#include "student.h"
void student::stuin()
{
std::cout << "学号:" ;
std::cin >> num;
std::cout << "姓名:" ;
std::cin >> name;
std::cout << "性别:" ;
std::cin >> sex;
std::cout << "年级:" ;
std::cin >> grade;
std::cout << "电话:" ;
std::cin >> tnum;
std::cout << "************************" << std::endl;
}
void student::stuout()
{
std::cout << "学号:" << num << std::endl ;
std::cout << "姓名:" << name << std::endl ;
std::cout << "性别:" << sex << std::endl ;
std::cout << "年级:" << grade << std::endl ;
std::cout << "电话:" << tnum << std::endl ;
}
student.h
#ifndef STUDENT_H_INCLUDED
#define STUDENT_H_INCLUDED
#endif STUDENT_H_INCLUDED
class student
{
public:
long num,tnum;
std::string name,sex;
int grade;
public:
void stuin();
void stuout();
};
求解求解!!!!!!!!!!!