473,718 Members | 2,066 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange link error when STL is used


I have the following:

class BSA
{
...
...
...
...
public:
enum VRGAttrId {
attrIdVRGNull,
attrIdVRGAdminS tatus,
attrIdVRGVRName s,
attrIdVRGRowSta tus,
attrIdVRGLocati ons
};
typedef set<VRGAttrId, less<VRGAttrId> > VRGAttrIdSet;
typedef pair<Status, VRGAttrId> VRGStatusPair;

}

when i compile/link, i am getting the following link error
In function `BSA::~BSA(void )':
undefined reference to
`rb_tree<BSA::V RGAttrId, BSA::VRGAttrId,
identity<BSA::V RGAttrId>, less<BSA::VRGAt trId>,
__alloc<true, 0> >::clear(void )'
The class "BSA" is composed of several other classes
and it used to compile and link fine, till I added the above
I dont have any "rb_tree" in the code. I guess this is some
STL internal symbol? How do i get rid of the problem?
thanks in adv

I am usung ccppc (win2k cross compiler for ppc ). Since this class
is huge I cant check with g++.
-sb

Jul 23 '05 #1
5 2123
"sriram" <sr*******@gmai l.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .

I have the following:
[Cut code using std::set or unadorned set.]
when i compile/link, i am getting the following link error
In function `BSA::~BSA(void )':
undefined reference to
`rb_tree<BSA::V RGAttrId, BSA::VRGAttrId,
identity<BSA::V RGAttrId>, less<BSA::VRGAt trId>,
__alloc<true, 0> >::clear(void )'
The class "BSA" is composed of several other classes
and it used to compile and link fine, till I added the above
I dont have any "rb_tree" in the code. I guess this is some
STL internal symbol? How do i get rid of the problem?
You need to link against the library that should
have been installed with your compiler that
provides that implementation of (std::)set.

You have likely got a misconfigured installation
of your compiler, or the include paths are messed
up, or the library search paths are messed up.
To help sort it out, you should take this to some
other forum where that would be topical, assuming
that you do not solve it yourself, of course.
thanks in adv You're welcome in retrospect.
I am usung ccppc (win2k cross compiler for ppc ). Since this class
is huge I cant check with g++.


Another compiler will not expose your problem
so much as add more confusion factors.

--
--Larry Brasfield
email: do************* **********@hotm ail.com
Above views may belong only to me.
Jul 23 '05 #2
The same class has other members using std::set in similar ways.
I am just extending this to the above class
To help sort it out, you should take this to some
other forum where that would be topical, assuming
that you do not solve it yourself, of course
Which forum? Can you suggest?
thanks again
-sb

sriram wrote: I have the following:

class BSA
{
..
..
..
..
public:
enum VRGAttrId {
attrIdVRGNull,
attrIdVRGAdminS tatus,
attrIdVRGVRName s,
attrIdVRGRowSta tus,
attrIdVRGLocati ons
};
typedef set<VRGAttrId, less<VRGAttrId> > VRGAttrIdSet;
typedef pair<Status, VRGAttrId> VRGStatusPair;

}

when i compile/link, i am getting the following link error
In function `BSA::~BSA(void )':
undefined reference to
`rb_tree<BSA::V RGAttrId, BSA::VRGAttrId,
identity<BSA::V RGAttrId>, less<BSA::VRGAt trId>,
__alloc<true, 0> >::clear(void )'
The class "BSA" is composed of several other classes
and it used to compile and link fine, till I added the above
I dont have any "rb_tree" in the code. I guess this is some
STL internal symbol? How do i get rid of the problem?
thanks in adv

I am usung ccppc (win2k cross compiler for ppc ). Since this class
is huge I cant check with g++.
-sb


Jul 23 '05 #3
"sriram" <sr*******@gmai l.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
The same class has other members using std::set in similar ways.
For some reason, I doubt that you are using the
std::set::clear () method in those other members.
Are you sure the similarity goes that far? I can
all but guarantee that the library destructor for
the std::set that came with your compiler has
been tested and the functions that it actually
needs can be found in the compiler distribution.

What I suspect has happened, (to elaborate
upon what I told you earlier), is that you have
mixed header files for one compiler with those
for another compiler. This sort of thing is easy
to do in cross-compilation scenarios. It need
not occur by actual mixing of incompatible
files in one directory; only the set of directories
searched by the compiler (as it was actually
invoked) need encompass the incompatible
set of files. Because of the variety of ways
that the search list and order is defined for
different compilers, the details of how this
occurs are off-topic here.
I am just extending this to the above class
There are really very few possibilities here:
1. The missing template definition should have
come directly or indirectly, from a header that
never got #include'd because of something in
your compiler's (as invoked) search order.
2. The missting template reference should not
have existed and would not have but for the
#include of an incorrect header, again due to
the compiler's search order being wrong.
3. Somebody has been doing something foul
with namespace manipulations that cause the
reference and definition to actually occur in
different namespaces, even though the design
of the library requires them to be in the same
namespace.

The error you have quoted, together with your
assertion that you did not explictly use the missing
function (and some knowledge of where template
function definitions must reside for your compiler)
leaves few alternatives, (at least that I can see).
To help sort it out, you should take this to some
other forum where that would be topical, assuming
that you do not solve it yourself, of course Which forum? Can you suggest?


Folks at the gnu.gcc.help newsgroup can help
you figure out what compiler installation details
have gotten fouled up to produce that error.
There is also a mailing list covering the ccppc
compiler at http://gcc.gnu.org/ml/gcc-help/ .

Of course, if the problem is foul namespace
manipulation, you will have to solve that.

At this point, I would suggest that you produce
a minimal program, preferrably all in one block
of text (except for system #include's), that still
exhibits this problem. Very likely, in the course
of creating that, you will discover what has gone
wrong. And if not, it will help others to get to
the bottom of the problem.
thanks again


Good luck.

[snip] when i compile/link, i am getting the following link error
In function `BSA::~BSA(void )':
undefined reference to
`rb_tree<BSA::V RGAttrId, BSA::VRGAttrId,
identity<BSA::V RGAttrId>, less<BSA::VRGAt trId>,
__alloc<true, 0> >::clear(void )'


--
--Larry Brasfield
email: do************* **********@hotm ail.com
Above views may belong only to me.
Jul 23 '05 #4
REH

"sriram" <sr*******@gmai l.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
when i compile/link, i am getting the following link error
In function `BSA::~BSA(void )':
undefined reference to
`rb_tree<BSA::V RGAttrId, BSA::VRGAttrId,
identity<BSA::V RGAttrId>, less<BSA::VRGAt trId>,
__alloc<true, 0> >::clear(void )'
The class "BSA" is composed of several other classes
and it used to compile and link fine, till I added the above
I dont have any "rb_tree" in the code. I guess this is some
STL internal symbol? How do i get rid of the problem?
thanks in adv

I am usung ccppc (win2k cross compiler for ppc ). Since this class
is huge I cant check with g++.
-sb

Use the C++ compiler (c++ppc, cxxppc, etc.), not the "generic" frontend. It
doesn't pull in the C++ libraries. Also, if you are compiling for VxWorks,
make sure you are NOT doing a full link (compile with -c and link with -r).

Jul 23 '05 #5
this is solved now. i overlooked the fact that I needed to do template
instantiation :(
shows i am dummy :) in c++
thanks for helpful advices to both of you
-sb

Jul 23 '05 #6

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

Similar topics

4
2838
by: Google Mike | last post by:
I have RH9 and am using the PHP and MySQL that came with it. I was doing fine with all manner of my web pages for this app until I started having this very strange problem. It's a work order mgmt system. I have 3 tables for the orders: TicketsOpen, TicketsVoided, and TicketsResolved. When one wants to void a ticket, they click it, choose Void, and it is copied to the TicketsVoided table, then removed from the TicketsOpen. And I can...
6
1795
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is coming from. Can you help? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD>
25
3727
by: Neil Ginsberg | last post by:
I have a strange situation with my Access 2000 database. I have code in the database which has worked fine for years, and now all of a sudden doesn't work fine on one or two of my client's machines. The code opens MS Word through Automation and then opens a particular Word doc. It's still working fine on most machines; but on one or two of them, the user is getting an Automation Error. The code used is as follows: Dim objWord As...
4
1616
by: Gav | last post by:
Hi all, I'm having this strange problem where, in a web app, I have 2 different links to a different form. One is just a straight forward link the other is a bit more complicated because it gets there from a user control I wrote to display a menu. However both call the page in the same way using window.open('page.aspx','_top'); The problem is that:.... The page it calls, in the page load, checks to see if a session variable is null,...
11
2593
by: Martin Joergensen | last post by:
Hi, I've encountered a really, *really*, REALLY strange error :-) I have a for-loop and after 8 runs I get strange results...... I mean: A really strange result.... I'm calculating temperatures. T = 20 degrees at all times.... The 2D T-array looks like this:
5
3107
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view showing a list of jobs from the database. When the main form loses focus and the user clicks the 'Close' button, I kept receiving error 2585 (This action cannot be carried out whilst processing a form or report event). This was tracked down to...
0
1338
by: maryjones11289 | last post by:
Hi, I have a strange problem that hopefully someone can advise me on... I have a Gridview which is not bound to a dataset etc. I populate the gridview manually by constructing my own table, defining grid columns then binding it to my table etc. Several of the columns in the gridview are of type ButtonField with ButtonType set to "Button" Now, all of this is working fine...no problems whatsoever.
8
1916
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I am migrating my C++ COM server to managed code (C# COM server). I am using the same client to use the same COM class in COM server. The C++ version COM server works properly, but when using the C# COM server, there is a strange error indicating dll is not installed correctly (data link error). I have tried to delete the DLL at the same time to test whether the DLL could be found correctly when the client is invoking...
4
2622
by: David | last post by:
I'm using the AxSHDocVw.WebBrowser control to download data from a webpage at work (it's an internal page on my company's intranet). The page produces a runtime error after a while and the strange thing is that until the page is refreshed with Internet Explorer, the error keeps occurring. I realize no one can debug an application that I can't even provide details about (I didn't write nor do I have access to it) but what difference...
0
8827
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
8724
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
9356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9053
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
7989
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
6654
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
5971
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4481
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...

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.