C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Strange liniking error with std::set usage

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
sriram
Guest





PostPosted: Tue Mar 15, 2005 3:55 pm    Post subject: Strange liniking error with std::set usage Reply with quote



I have posted this on comp.lang.c++ and I am posting here too:
I have the following:


class BSA
{
...
...
...
...
public:
enum VRGAttrId {
attrIdVRGNull,
attrIdVRGAdminStatus,
attrIdVRGVRNames,
attrIdVRGRowStatus,
attrIdVRGLocations
};
typedef set<VRGAttrId, less 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::VRGAttrId, BSA::VRGAttrId,
identity __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


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Mary K. Kuhner
Guest





PostPosted: Wed Mar 16, 2005 8:51 am    Post subject: Re: Strange liniking error with std::set usage Reply with quote



In article <1110861312.631896.126960 (AT) l41g2000cwc (DOT) googlegroups.com>,
sriram <sriramb12 (AT) gmail (DOT) com> wrote:

Quote:
when i compile/link, i am getting the following link error
In function `BSA::~BSA(void)':
undefined reference to
`rb_tree<BSA::VRGAttrId, BSA::VRGAttrId,
identity __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?

rb_tree is almost surely a red-black tree, a common algorithm
for implementing std::set and std::map. So this points at something
amiss with your set. The error message parses out to "I couldn't
put the compiler-generated destructor together because I
couldn't find one of the std::set functions."

Did you write less<BSA::VRGAttrID>? Is it somewhere that it
can be found?

One that bites me all the time: does this class have virtual
functions? If so, have you implemented every one of them? While
an unimplemented regular function is not a problem, an
unimplemented virtual function often gives link errors that
complain about some other, innocent function (in gcc, often the
constructor or destructor).

Mary Kuhner [email]mkkuhner (AT) eskimo (DOT) com[/email]


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

Back to top
Ismail Pazarbasi
Guest





PostPosted: Wed Mar 16, 2005 9:05 am    Post subject: Re: Strange liniking error with std::set usage Reply with quote



it looks fine. what's your compiler and STL vendor? does "set" work in
other projects?

Ismail


[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.