Here is the terminal that shows me? kindly if anyone know this
warning: relocation against _ZN7Student7counterE' in read-only section
.text’
/usr/bin/ld: /tmp/ccsORc5r.o: in function Student::Student()': Main.cpp:(.text+0x200): undefined reference to
Student::counter’
/usr/bin/ld: Main.cpp:(.text+0x209): undefined reference to Student::counter' /usr/bin/ld: /tmp/ccsORc5r.o: in function
Student::Student(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char, int, int)’:
Main.cpp:(.text+0x2c5): undefined reference to Student::counter' /usr/bin/ld: Main.cpp:(.text+0x2ce): undefined reference to
Student::counter’
/usr/bin/ld: /tmp/ccsORc5r.o: in function Student::~Student()': Main.cpp:(.text+0x32a): undefined reference to
Student::counter’
/usr/bin/ld: /tmp/ccsORc5r.o:Main.cpp:(.text+0x333): more undefined references to Student::counter' follow /usr/bin/ld: /tmp/ccsORc5r.o: in function
Admin::addCourse()’:
Main.cpp:(.text+0xc8a): undefined reference to Course::Course()' /usr/bin/ld: Main.cpp:(.text+0xdaa): undefined reference to
Course::Course()’
/usr/bin/ld: Main.cpp:(.text+0xf39): undefined reference to Course::Course()' /usr/bin/ld: /tmp/ccsORc5r.o: in function
Admin::addTeacher()’:
Main.cpp:(.text+0x1395): undefined reference to Professor::Professor()' /usr/bin/ld: Main.cpp:(.text+0x147c): undefined reference to
Professor::Professor()’
/usr/bin/ld: Main.cpp:(.text+0x1610): undefined reference to `Professor::Professor()’
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
i also try to compile through the makefile but still same error undefined reference
Haris Arain is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.