help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Undefined symbol when loading g++ created library


From: Robert Heller
Subject: Re: Undefined symbol when loading g++ created library
Date: Mon, 28 Nov 2005 15:49:49 +0100

  Adam Nielsen <a.nielsen@shikadi.rem.ove.net>,
  In a message on Mon, 28 Nov 2005 09:59:55 +1000, wrote :

AN> > >   plugin.so: undefined symbol: _ZN8RootClassC2Ev
AN> > Hmm. Are you (mis)typing this instead of cut/pasting?
AN> 
AN> Nope, that was a cut and paste and I just double checked it - that's
AN> exactly what dlerror reports.
AN> 
AN> > You should begin by running 'nm Main | grep RootClass' and verifying
AN> > that there is a definition of this constructor in Main to begin with
AN> 
AN> Like Robert suggested, I think this is the problem.  There are a bunch
AN> of RootClass symbols in Main, but I don't really know what I'm looking
AN> for.  The C2Ev one's not there, but there are a few others that are
AN> close:
AN> 
AN>   _ZN8RootClassC[12]ESs
AN>   _ZN8RootClassD[012]Ev
AN>   _ZT[ISTV]8RootClass
AN> 
AN> I did however just try adding some dummy code to Main to call every
AN> single constructor in RootClass, just to make sure the code was being
AN> included, however this didn't make a difference...!

The GNU/Binutils nm command has the option, --demangle, which is useful.
Use this with both the shared library module, plugin.so, to determine
just what _ZN8RootClassC2Ev is (which constructor) and also do it on
Main as well (to determine just which constructors are defined).

There might be an 'implicit' constructor being used in your plugin, that
is in fact not defined elsewhere.

AN> 
AN> Thanks,
AN> Adam.
AN>                            

                                     \/
Robert Heller                        ||InterNet:   heller@deepsoft.com
http://www.deepsoft.com/             ||FidoNet:    1:321/153            
http://www.deepsoft.com/~heller      /\






                                                                                
          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]