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

  • Home
  • SEARCH
  • 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 7536169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:30:11+00:00 2026-05-30T06:30:11+00:00

There is one header a file Rectangle.hxx #ifndef Rectangle_included #define Rectangle_included #include <iostream> #include

  • 0

There is one header a file Rectangle.hxx

#ifndef Rectangle_included
#define Rectangle_included
#include <iostream>
#include <math.h>
#include "GetL.hxx"
using namespace std;

class Rectangle: public GetL
{
int width;
int value;
public:
Rectangle();
Rectangle(int v, int w);
Rectangle(const Rectangle& b);
int getWidth();
int getValue();
Rectangle & plus(int newval);
};
#endif //Rectangle_included

The file GetL.hxx is defined like this:

#ifndef GetL_included
#define GetL_included
#include <iostream>
using namespace std;
class GetL
{
public:
virtual int getWidth();
};
#endif //GetL_include

The file Rectangle.cxx contains various definitions:

#include <iostream>
#include <math.h>
#include "Rectangle.hxx"
using namespace std;

Rectangle::Rectangle()
{
 value=0;
 width=0;
}
Rectangle::Rectangle(int v, int w)
{
 value=v;
 width=w;
}
Rectangle::Rectangle(const Rectangle& b)
{
 value= b.value;
 width= b.width;
}
int Rectangle::getWidth()
{
 return width;
}
int Rectangle::getValue()
{
  return value;
}
Rectangle& Rectangle::plus(int newval)
{
  value+=newval;
  if(value>=pow(2,width))
cout<<"Overflow";
  return *this;
}

But i am getting the error on compiling Rectangle.cxx.

/tmp/cclETn3R.o:Rectangle.cxx:(.text$_ZN4GetLC2Ev[GetL::GetL()]+0*8): undefined reference to 'vtable for Getl'

How can i remove it? How can i define file GetL.cxx or i don’t need to?

  • 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-30T06:30:13+00:00Added an answer on May 30, 2026 at 6:30 am

    You need to compile the different files without linking first. On UNIX compilers this is typically done using the -c option. When building the executable you then specify all the produced .o objects. Alternatively you can specify all source files at once but this is really only viable for very small projects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a compiler error with this header file: #ifndef GAME1_H #define GAME1_H #include
In one header file I have: #include BaseClass.h // a forward declaration of DerivedClass,
In one header file, i have a inline function define like bellow: extern CMODEXPORT
Is there a general term for a pairing of tables where one has header
Network file systems are offered by Windows and (L)Unix. Is there one for IBM
Is there a way to insert a header at the top of a file?
I have C++ project (VS2005) which includes header file with version number in #define
I've opened winnt.h header file and found there this two lines: typedef wchar_t WCHAR;
With C++, I can have one class definition in a header file, and have
I have one class, called A, and it has it's own header file. Then

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.