473,395 Members | 1,454 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

undefined reference to `vtable for ...

bp
Hi,

Could someone to tell me what I'm doing wrong? I'm using
gcc version 3.3.4 and
ld version 2.15.90.0.3 20040415

the linker message is:

.../obj/classOpenAreaForm.o(.text+0x211): In function
`TOpenAreaForm::TOpenAreaForm[not-in-charge](TControl*)':
.../src/appforms/classOpenAreaForm.cpp:66: undefined reference to `vtable
for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x367): In function
`TOpenAreaForm::TOpenAreaForm[in-charge](TControl*)':

.../appforms/classOpenAreaForm.cpp:66: undefined reference to `vtable for
TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x4ce): In function
`TOpenAreaForm::TOpenAreaForm[not-in-charge](TControl*, int, int, int,
int, char const*)':

.../src/appforms/classOpenAreaForm.cpp:86: undefined reference to `vtable
for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x638): In function
`TOpenAreaForm::TOpenAreaForm[in-charge](TControl*, int, int, int, int,
char const*)':

.../src/appforms/classOpenAreaForm.cpp:86: undefined reference to `vtable
for TOpenAreaForm' collect2: ld returned 1 exit status

the headers of the involved classes:

TControl.h
______________
#ifndef __CONTROL_HPP_
#define __CONTROL_HPP_

class TControl
{
protected:
TControl *parent;
.....
public:
TControl(TControl *parent_);
TControl(TControl *parent_, int left_,int top_,
int width_,int height_,const char* caption_='\0');
virtual ~TControl(void);
....
};
#endif
--------------------

TForm.h
_________________
#include "classControl.hpp"

class TForm : public TControl {
protected:
virtual void Draw(void);
public:
TForm(TControl *parent_);
TForm(TControl *parent_, int left_, int top_, int width_,
int height_, const char* caption_);
.......
};
....
#endif

--------------------
TOpenAreaForm.h
_________________
#ifndef __OPENAREAFORM_HPP_
#define __OPENAREAFORM_HPP_
#include "../appgui/classForm.hpp"
// forward declaration
class TListView;

class TOpenAreaForm : public TForm {
public:
TOpenAreaForm(TControl *parent_);
TOpenAreaForm(TControl *parent_, int left_, int top_,
int width_, int height_, const char* caption_);
~TOpenAreaForm(void);
TListView* filelist;
void RefreshListItems(void);
};
....
#endif

------------

Thanks
Jul 22 '05 #1
3 3425

"bp" <bp@bp.aa> wrote in message
news:pa****************************@bp.aa...
Hi,

Could someone to tell me what I'm doing wrong? I'm using
gcc version 3.3.4 and
ld version 2.15.90.0.3 20040415

the linker message is:

../obj/classOpenAreaForm.o(.text+0x211): In function
`TOpenAreaForm::TOpenAreaForm[not-in-charge](TControl*)':
../src/appforms/classOpenAreaForm.cpp:66: undefined reference to `vtable
for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x367): In function
`TOpenAreaForm::TOpenAreaForm[in-charge](TControl*)':

I don't know if this will help you, but I got this one time when I declared
a virtual member but failed to define it.

Jul 22 '05 #2
bp
On Fri, 20 Aug 2004 15:49:38 -0400, Xenos wrote:
I don't know if this will help you, but I got this one time when I declared
a virtual member but failed to define it.


It helped.
Thank you
Jul 22 '05 #3
bp wrote:
Hi,

Could someone to tell me what I'm doing wrong? I'm using
gcc version 3.3.4 and
ld version 2.15.90.0.3 20040415

the linker message is:

../obj/classOpenAreaForm.o(.text+0x211): In function
`TOpenAreaForm::TOpenAreaForm[not-in-charge](TControl*)':
../src/appforms/classOpenAreaForm.cpp:66: undefined reference to
`vtable for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x367): In
function `TOpenAreaForm::TOpenAreaForm[in-charge](TControl*)':

../appforms/classOpenAreaForm.cpp:66: undefined reference to `vtable
for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x4ce): In
function `TOpenAreaForm::TOpenAreaForm[not-in-charge](TControl*, int,
int, int, int, char const*)':

../src/appforms/classOpenAreaForm.cpp:86: undefined reference to
`vtable for TOpenAreaForm' ../obj/classOpenAreaForm.o(.text+0x638): In
function `TOpenAreaForm::TOpenAreaForm[in-charge](TControl*, int, int,
int, int, char const*)':

../src/appforms/classOpenAreaForm.cpp:86: undefined reference to
`vtable for TOpenAreaForm' collect2: ld returned 1 exit status

the headers of the involved classes:

TControl.h
______________
#ifndef __CONTROL_HPP_
#define __CONTROL_HPP_
Identifiers containing two consecutive underscores are reserved for the
implementation (i.e. the compiler and its standard library). You are
not allowed to define any of those yourself.
class TControl
{
protected:
TControl *parent;
....
public:
TControl(TControl *parent_);
TControl(TControl *parent_, int left_,int top_,
int width_,int height_,const char* caption_='\0');
That might not do what you expect it to. '\0' is usually used as a
string termination character - a character with the value 0. But your
char* will not be assigned the address of such a 0 character. Rather it
will become a null pointer, since '\0' would just be an integer with
the value zero, which is in a pointer context interepreted a null
pointer constant, and _not_ a character constant. What you might have
wanted is:

TControl(TControl *parent_, int left_,int top_,
int width_,int height_,const char* caption_="");

virtual ~TControl(void);
....
};
#endif
--------------------

TForm.h
_________________
#include "classControl.hpp"

class TForm : public TControl {
protected:
virtual void Draw(void);
Is that Draw() member function actually defined anywhere?
public:
TForm(TControl *parent_);
TForm(TControl *parent_, int left_, int top_, int width_,
int height_, const char* caption_);
......
};
...
#endif

--------------------
TOpenAreaForm.h
_________________
#ifndef __OPENAREAFORM_HPP_
#define __OPENAREAFORM_HPP_
#include "../appgui/classForm.hpp"
// forward declaration
class TListView;

class TOpenAreaForm : public TForm {
public:
TOpenAreaForm(TControl *parent_);
TOpenAreaForm(TControl *parent_, int left_, int top_,
int width_, int height_, const char* caption_);
~TOpenAreaForm(void);
TListView* filelist;
void RefreshListItems(void);
};
...
#endif

------------

Thanks


--
This project is so important, we can't let things that are more
important interfere with it.
(Advertising/Marketing manager, United Parcel Service)

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Daniel Heiserer | last post by:
Hi, I got the following compiling/linking error, but I have no clue what it is about. Can anybody help me? thanks, daniel
2
by: Quansheng Liang | last post by:
Hello, I struggled with the problem of "undefined reference to `vtable ...`" while migrating a project from windows to linux. After searching the google I removed all the inline functions and now...
9
by: alessandro | last post by:
Compiling my current project I received the following error: undefined reference to `vtable for Tuner' The only two things I know are that the error occours when trying to invoke the constructor...
7
by: Karl Ebener | last post by:
Hi! I have created a program using several classes with inheritage. When I compile and link, I get the following error: :$ g++ service2.cpp Service.cpp Application.cpp Message.cpp...
9
by: jimjim | last post by:
Hello all, class Base { public: virtual void f(); }; class Derived : public Base{ private: int i; };
4
by: Mark | last post by:
Hi, I'm trying to write some classes that kind of manage themselves. A linked list, that links different types of objects. Here's the code... object.h: --- class Object { int alt;
5
by: pavan734 | last post by:
Hi, Iam facing problem with undefined reference linking errors. To explain in more detail.. I have a class called TOP. In its constructor I have instantiated many other class objects using...
5
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget...
2
by: boyphp | last post by:
I'm getting the following undefined reference errors: foo_test.o(.gnu.linkonce.t._ZN7CFooD1Ev+0x18): In function `CFoo::~CFoo()': : undefined reference to `vtable for CFoo'...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.