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: Sun, 27 Nov 2005 14:29:50 +0100

  Paul Pluzhnikov <ppluzhnikov-nsp@charter.net>,
  In a message on Sat, 26 Nov 2005 23:00:22 -0800, wrote :

PP> Adam Nielsen <a.nielsen@shikadi.rem.ove.net> writes:
PP> 
PP> > Well at any rate it's the mangled version of RootClass:
PP> >
PP> >   plugin.so: undefined symbol: _ZN8RootClassC2Ev
PP> 
PP> Hmm. Are you (mis)typing this instead of cut/pasting?
PP> 
PP> The '_ZN8RootClassC2Ev' is not a valid mangled symbol at all;
PP> the '_ZN9RootClassC2Ev' is "RootClass::RootClass[not-in-charge]()"
PP> constructor.
PP> 
PP> >> If that's what you did, please try to construct a trivial compilable
PP> >> example, and provide *exact* compile and link lines and gcc and OS
PP> >> versions.
PP> >
PP> > If this is unexpected behaviour I'll see if I can do that.
PP> 
PP> Yes, this is unexpected.
PP> 
PP> You should begin by running 'nm Main | grep RootClass'
PP> and verifying that there is a definition of this constructor in
PP> Main to begin with (if there isn't, -rdynamic wouldn't make a
PP> difference -- you can't export what's not defined).

Right.  If there are no instances of RootClass in your main, it is
possible that the constructor won't get linked in the main's executable,
depending on how you linked things.  Eg if you have a *static* library
(libmumble.a) containing the constructor of RootClass, the linker might
not have a reason to include the code. for the constructor if it is not
referenced by the main program.

PP> 
PP> Cheers,
PP> -- 
PP> In order to understand recursion you must first understand recursion.
PP> Remove /-nsp/ for email.
PP>                             

                                     \/
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]