hey, i got undefined reference error from my main function, but i can not find the problem. my files are:
//Student.h
#ifndef STUDENT_H
#define STUDENT_H
#include <vector>
#include <string>
class Student{
public:
Student(std::string &line);
...
virtual void evaluateValue(){}
virtual ~Student(){}
....
};
#endif
//HeStudent.h
#ifndef HESTUDENT_H
#define HESTUDENT_H
#include "Student.h"
class HeStudent : public Student{
public:
HeStudent(std::string line) : Student(line){
...
}
static int AgradesCount;
static double Aaverage;
virtual void evaluateValue();
virtual ~HeStudent(){}
};
#endif
for each .h file there is his .cpp file. i've got also a main.cpp file which contains the main and in the main i create: Student stud = new HeStudent(line); i don't know if it's necessary but i included the Student.h and the HeStudent.h and i get some long error and it said:
HeStudent::HeStudent(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)]+0x22): undefined reference to `Student::Student
can anyone tell me what is the problem?