this is the error i'm getting.
g++ main.cpp
g++ universityperson.cpp
/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crt1.o(.text+0x18): In function `_start':
: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [universityperson.o] Error 1
I'm not going to post all the code i have but here is my makefile main file and universityperson files
//makefile
UniversityPerson : main.o universityperson.o employee.o academic.o faculty.o \
teacher.o administration.o support.o student.o
g++ -o UniversityPerson main.o universityperson.o employee.o academic.o\
faculty.o teacher.o administration.o support.o student.o
main.o : main.cpp universityperson.h
g++ main.cpp
universityperson.o : universityperson.cpp universityperson.h
g++ universityperson.cpp
employee.o : employee.cpp employee.h
g++ employee.cpp
academic.o : academic.cpp academic.h
g++ academic.cpp
faculty.o : faculty.cpp faculty.h
g++ faculty.cpp
teacher.o : teacher.cpp teacher.h
g++ teacher.cpp
administration.o : administration.cpp administration.h
g++ administration.cpp
support.o : support.cpp support.h
g++ support.cpp
student.o : student.cpp student.h
g++ student.cpp
//main.cpp (obviously havent started yet, just a test to compile)
// the include statements include the lowest of the class hierarchy, therefor each of these will
// include all the way up to universityperson.h which includes lib.h
#include "teacher.h"
#include "administration.h"
#include "support.h"
#include "student.h"
int main( int argc, char *argv[] ){
return 0;
}
//universityperson.cpp
#include "universityperson.h"
string UNIVERSITYPERSON::getFullName(){
return fullname;
}
string UNIVERSITYPERSON::getID(){
return id;
}
string UNIVERSITYPERSON::getPosition(){
return position;
}
//universityperson.h
#ifndef UNIVERSITYPERSON_H
#define UNIVERSITYPERSON_H
#include "lib.h"
class UNIVERSITYPERSON{
string fullname, id, position;
public:
UNIVERSITYPERSON(){
fullname = "No Name";
id = "00000000";
position = "University Person";
};
string getFullName();
string getID();
string getPosition();
};
#endif