473,396 Members | 1,916 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,396 software developers and data experts.

need help with undefined reference errors

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'
foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x19): In function
`CFoo::CFoo()':
: undefined reference to `CFoo::rmap'
foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x30): In function
`CFoo::CFoo()':
: undefined reference to `vtable for CFoo'

The implementation of the concerned functions is given below. I'm
pretty sure it is reading the file. What exactly could be going wrong?
------------------------------------------------------------------------------------------------------------------
class CFoo : public CIFoo
{
public:
CFoo() : CIFoo( PID_FOO, rmap) {};

CFoo( const CFoo& c ) : CIFoo( PID_Foo, rmap )
{
}

~CFoo()
{
}
private:
char* rmap;
};

May 2 '07 #1
2 2141
Without the full source code, I am guessing the base class `CIFoo' has
no virtual destructor.

May 2 '07 #2
boyphp wrote:
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'
foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x19): In function
`CFoo::CFoo()':
>undefined reference to `CFoo::rmap'
foo_test.o(.gnu.linkonce.t._ZN7CFooC1Ev+0x30): In function
`CFoo::CFoo()':
>undefined reference to `vtable for CFoo'

The implementation of the concerned functions is given below. I'm
pretty sure it is reading the file. What exactly could be going wrong?
[..]

Quoting the Standard:
"A virtual member function shall be declared pure _or_ defined
_or_ both."

That means you cannot declare a virtual function but not define it.
Also, it's possible that the base class of CFoo has pure d-tor...
The cod you posted does not have enough information in it.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 2 '07 #3

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

Similar topics

2
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on...
1
by: Foolster41 | last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a windows XP OS. I'm trying to compile the code for a multi user dungeon (MUD) called circle-mud. When I compile I get the...
10
by: Tayfun Özdemir | last post by:
Hello there, I have a school project and I have to finish it soon. I have to implement B+ Tree for the project. I have TreeNode template class. That will be used to hold keys in the tree...
3
by: Ryan Riehle | last post by:
Hi All! Trying to upgrade to Apache 2.0.49 and getting compile errors related to mod_auth_pgsql, any clue?: make: Entering directory `/usr/src/httpd-2.0.49'...
66
by: genestarwing | last post by:
QUESTION: Write a program that opens and read a text file and records how many times each word occurs in the file. Use a binary search tree modified to store both a word and the number of times it...
0
by: Michael Yanowitz | last post by:
Hello: I am just trying out SWIG, but quickly ran into problems. Using Cygwin gcc, I tried the following: 1) Created example.c (as given on http://www.swig.org/tutorial.html ) /* File :...
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...
4
by: urkel | last post by:
Hello everybody, I am getting bogged-down by these errors troubling me for the last few days I am writing a C program with a main and several user-defined functions. One of the user-defined...
1
by: yeah | last post by:
hi friends I tried to link c++ object files using "bfin-elf-ld" and got some undefined reference errors Errors::::: (.text+0x2ee8): undefined reference to `operator delete(void*)'...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...

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.