[Top][All Lists]

[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 <address@hidden>,
  In a message on Sat, 26 Nov 2005 23:00:22 -0800, wrote :

PP> Adam Nielsen <address@hidden> writes:
PP> > Well at any rate it's the mangled version of RootClass:
PP> >
PP> > undefined symbol: _ZN8RootClassC2Ev
PP> Hmm. Are you (mis)typing this instead of cut/pasting?
PP> The '_ZN8RootClassC2Ev' is not a valid mangled symbol at all;
PP> the '_ZN9RootClassC2Ev' is "RootClass::RootClass[not-in-charge]()"
PP> constructor.
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> Yes, this is unexpected.
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> Cheers,
PP> -- 
PP> In order to understand recursion you must first understand recursion.
PP> Remove /-nsp/ for email.

Robert Heller                        ||InterNet:   address@hidden             ||FidoNet:    1:321/153         /\


reply via email to

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