Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6099435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:16:23+00:00 2026-05-23T13:16:23+00:00

I am having a compilation problem. The following are the files and the inheritance.

  • 0

I am having a compilation problem. The following are the files and the inheritance.

dateType.h, dateTypeImp.cpp: define and implement dateType class
addressType.h, addressTypeImp.cpp: define and implement addressType class
personType.h, personTypeImp.cpp: define and implement personType class
extPersonType.h, extPersonTypeImp.cpp: define and implement extPersonType class
addressBookType.h, addressBookTypeImp.cpp: define and implement addressBookType class

The following is the inheritance and has-the relationships.
extPersonType “extends”(inheritance) personType class and it also “has” one object of each addressType and dateType.
addressBookType class “has” 500 objects of type extPersonType.
(I can copy paste the .h files in case thats needed)
Hence extPersonType.h has #include statements for “dateType.h”, “addressType.h”, “personType.h” in it. addressBookType.h has #include “extPersonType.h” in it.

I have the following Makefile:

all: main



personTypeImp.o: personTypeImp.cpp
    g++ -c -Wall personTypeImp.cpp

dateTypeImp.o: dateTypeImp.cpp
    g++ -c -Wall dateTypeImp.cpp

addressTypeImp.o: addressTypeImp.cpp
    g++ -c -Wall addressTypeImp.cpp

addressBookTypeImp.o: addressBookTypeImp.cpp
    g++ -c -Wall addressBookTypeImp.cpp

main.o: main.cpp
    g++ -c -Wall main.cpp

main: main.o addressBookTypeImp.o addressTypeImp.o dateTypeImp.o personTypeImp.o
    g++ -Wall main.o addressBookTypeImp.o addressTypeImp.o dateTypeImp.o personTypeImp.o -o main


clean:
    rm -f *.o *~ main

All the .o lines are compiled without errors. The last “main” compilation gives this error:

make
g++ -c -Wall main.cpp
g++ -c -Wall addressBookTypeImp.cpp
g++ -c -Wall addressTypeImp.cpp
g++ -c -Wall dateTypeImp.cpp
g++ -c -Wall personTypeImp.cpp
g++ -Wall main.o addressBookTypeImp.o addressTypeImp.o dateTypeImp.o personTypeImp.o -o main
Undefined                       first referenced
 symbol                             in file
extPersonType::getStatus() const    addressBookTypeImp.o
extPersonType::isLastName(std::basic_string<char, std::char_traits<char>, std::allocator<char> >) constaddressBookTypeImp.o

More functions from extPersonType are listed.

Wondering what could be the error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:16:24+00:00Added an answer on May 23, 2026 at 1:16 pm

    The key part of the error message is:

    Undefined symbol extPersonType::....

    Basically, the symbols for class extPersonType are not part your program. If you look at the makefile, you’ll see that

    extPersonTypeImp.o: extPersonTypeImp.cpp
        g++ -c -Wall extPersonTypeImp.cpp
    

    is missing and that you need to add extPersonType.o to the linker command as such

    g++ -Wall main.o addressBookTypeImp.o addressTypeImp.o dateTypeImp.o personTypeImp.o extPersonTypeImp.o -o main
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem on my TeamCity CI build server where during compilation I
I'm new to C++, and I'm having a problem with my class definitions in
I'm having a problem with implicit conversion in the following code: trait A {
My program is seemingly having a deadlock problem. Basically I have a class that
I am having problem with following code. Its showing compliation error:- Identifier Expected. <script
Having a problem getting a TreeView control to display node images. The code below
[Updated below] I am having a problem connecting to a MySQL database using a
the problem is the following. We have a (rather large) code base in form
I am having a problem stepping into code which is a website hosted on
I am having problems compiling the following snippet int temp; vector<int> origins; vector<string> originTokens

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.