473,791 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help me with undefined references

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 pointers.
Iam getting errors like
1. In function TOP::TOP(int) : undefined reference to
CHILD1::CHILD1( int, float).
2. In function TOP::TOP(int) : undefined reference to vtt for
CHILD2::CHILD2( char*)
3. In function TOP::TOP(int) : undefined reference to vtable for
CHILD3::CHILD3( )
4.In function TOP ::func() undefined reference to CHILD3:: func2()

What could be possible reasons for getting such errors.

Jun 30 '06 #1
5 2818
pa******@gmail. com wrote:
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 pointers.
Iam getting errors like
1. In function TOP::TOP(int) : undefined reference to
CHILD1::CHILD1( int, float).
2. In function TOP::TOP(int) : undefined reference to vtt for
CHILD2::CHILD2( char*)
3. In function TOP::TOP(int) : undefined reference to vtable for
CHILD3::CHILD3( )
4.In function TOP ::func() undefined reference to CHILD3:: func2()

What could be possible reasons for getting such errors.

You haven't linked the object files for those classes?

Using all upper case for class names is rather an odd style.

--
Ian Collins.
Jun 30 '06 #2
Hi,

I think u have to do forward declaration of classes which you created
instances.

Regards,
Mukil
pa******@gmail. com wrote:
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 pointers.
Iam getting errors like
1. In function TOP::TOP(int) : undefined reference to
CHILD1::CHILD1( int, float).
2. In function TOP::TOP(int) : undefined reference to vtt for
CHILD2::CHILD2( char*)
3. In function TOP::TOP(int) : undefined reference to vtable for
CHILD3::CHILD3( )
4.In function TOP ::func() undefined reference to CHILD3:: func2()

What could be possible reasons for getting such errors.


Jun 30 '06 #3
Mukian wrote:

Please don't top post.

pa******@gmail. com wrote:
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 pointers.
Iam getting errors like
1. In function TOP::TOP(int) : undefined reference to
CHILD1::CHILD 1(int, float).
2. In function TOP::TOP(int) : undefined reference to vtt for
CHILD2::CHILD 2(char*)
3. In function TOP::TOP(int) : undefined reference to vtable for
CHILD3::CHILD 3( )
4.In function TOP ::func() undefined reference to CHILD3:: func2()

What could be possible reasons for getting such errors.


Hi,

I think u have to do forward declaration of classes which you created
instances.

Who's u?

The OP is getting linker errors, not compile errors.

--
Ian Collins.
Jun 30 '06 #4

pa******@gmail. com wrote:
Hi,
Iam facing problem with undefined reference linking errors.
To explain in more detail..

What could be possible reasons for getting such errors.


I have found out that such errors will come if a function is declared
in a class and its definition is not provided, then also we get
undefined reference. But Iam thinking whether there are any other
reasons for such errors.

Jun 30 '06 #5
pa******@gmail. com wrote:

pa******@gmail. com wrote:
Hi,
Iam facing problem with undefined reference linking errors.
To explain in more detail..

What could be possible reasons for getting such errors.


I have found out that such errors will come if a function is declared
in a class and its definition is not provided, then also we get
undefined reference. But Iam thinking whether there are any other
reasons for such errors.


Maybe. How we can we possibly tell if you hid information from us? SHOW
US THE CODE. Post a complete, minimal program the demonstrates the
problem.

Actually, before you do anything else, read this:

<http://www.parashift.c om/c++-faq-lite/how-to-post.html#faq-5.8>


Brian
Jun 30 '06 #6

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

Similar topics

21
6561
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
9
2718
by: Pemburger | last post by:
From: pemburger@aol.com I've tried the W3C MarkUp Validation Service for the following web page: http://www.coverscript.com The report given by W3C shows 300 plus errors? I am not able to understand their explanations on the errors. As per W3C's info that if I am having problems with validation -- try for some
2
1614
by: Reply Via Newsgroup | last post by:
Folks, Windows, and refering to them (be they in seperate frames or in a popup) always catch me... There is parent, top, self, the name of the window itself and where it sits when refering to its full property name... It drives me up the wall that I can't get this right after six months or so... Before someone gives me a spiel on not using popups: 1) It is for an intranet LAMP based application and
6
15227
by: marktm | last post by:
Hi- I am trying to use setInterval to call a method within an object and have not had any luck. I get "Object doesn't support this property or method" when I execute the following code. What I am doing wrong? Your help will be much appreciated. Thanks
2
1675
by: DD | last post by:
I have developed a a nice little software package(Packaged with Wise and SageKey) My product works great in a clean enviroment on Win98 and Win2k and XP As soon as i introduce Office 2000 Pro onto either Win98 or Win2K i get an error on certian forms "Undefined Function DlookUp" or "undefined Function Nz expression". If i remove the Nz from expressions on an affending form it opens with out a problem. I however have lots of Nz in...
7
2170
by: dam_fool_2003 | last post by:
friends, I wanted to learn the various ways of inserting a single list. so: Method 1: #include<stdlib.h> #include<stdio.h> struct node { unsigned int data; struct node *next;
4
3055
by: Chris | last post by:
I've lurked around long enough... Time to interract =) I'm trying to make sense of the following. I can't quite wrap my head around what this is actually doing: ------------- typedef enum { DOUBLE_LIST, INT_LIST } DATA_TYPE; typedef struct { DATA_TYPE type;
23
3290
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
49
14530
by: matty | last post by:
Hi, I recently got very confused (well that's my life) about the "undefined" value. I looked in the FAQ and didn't see anything about it. On http://www.webreference.com/programming/javascript/gr/column9/ they say: <snip> The undefined property A relatively recent addition to JavaScript is the undefined property.
2
6359
by: embz | last post by:
this post concerns three pages. 1. this page: http://www.katherine-designs.com/sendemail.php i get the following errors: a lot of it seems to deal with the PHP code i inserted to the page. as my PHP skills are close to nil, i'm wary about fiddling with it myself. =\ 2. now this page: http://www.katherine-designs.com/contact.php
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.