Question
I tried to run this program but I get this error: g++ -g -std=c++0x Person.o Student.o Instructor.o Building.o University.o main.o -o prog Student.o:(.rodata._ZTI7Student[_ZTI7Student]+0x10): undefined reference
I tried to run this program but I get this error: g++ -g -std=c++0x Person.o Student.o Instructor.o Building.o University.o main.o -o prog Student.o:(.rodata._ZTI7Student[_ZTI7Student]+0x10): undefined reference to `typeinfo for Person' Instructor.o:(.rodata._ZTI10Instructor[_ZTI10Instructor]+0x10): undefined reference to `typeinfo for Person' main.o: In function `main': main.cpp:27: undefined reference to `Person::setName(std::string)' main.cpp:28: undefined reference to `Person::setAge(int)' main.cpp:30: undefined reference to `Person::setName(std::string)' main.cpp:31: undefined reference to `Person::setAge(int)' main.cpp:135: undefined reference to `Person::setName(std::string)' main.cpp:136: undefined reference to `Person::setAge(int)' main.cpp:178: undefined reference to `Person::setName(std::string)' main.cpp:179: undefined reference to `Person::setAge(int)' main.o: In function `Person::Person()': Person.hpp:17: undefined reference to `vtable for Person' main.o: In function `Person::~Person()': Person.hpp:17: undefined reference to `vtable for Person' collect2: error: ld returned 1 exit status make: *** [Prog] Error 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started