[Top][All Lists]

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

Re: problem linking with shared library

From: Albert Chin
Subject: Re: problem linking with shared library
Date: Wed, 12 Oct 2005 13:18:36 -0500
User-agent: Mutt/1.5.6i

On Wed, Oct 12, 2005 at 01:03:12PM -0500, Nitesh Soni (NC/TNT) wrote:
> The error linker is giving is: ... undefined reference to
> 'Z'
> Also, this symbol is not used anywhere in any source code required
> to build application X ( i mean if X depends on x.c y.c z.c and
> library libY .. none of the sources x.c y.c and z.c use this symbol)

That's ok. libY might be dependent on another library where Z is

> I am using gcc version 3.3.1 ( MontaVista ) building for x86.

Odd that static linking works. You can extract the object files from
libY.a to determine which one has Z undefined. As you have the source
to libY, you can find out why the symbol is undefined.

> -----Original Message-----
> From: Albert Chin [mailto:address@hidden
> Sent: Wednesday, October 12, 2005 1:25 PM
> To: Nitesh Soni (NC/TNT)
> Cc: address@hidden
> Subject: Re: problem linking with shared library
> On Wed, Oct 12, 2005 at 11:22:42AM -0500, Nitesh Soni (NC/TNT) wrote:
> > I am trying to build an executable "X" which links with libY.
> > 
> > I am using libtool to build this library libY; so I have a static
> > version libY.a and
> > 
> > When I link the static version libY.a, i am able to build the
> > application X But when I link against the shared version I
> > am not able to build the application; it fails with some undefined
> > reference to (lets say) Z
> > 
> > Now I did "nm libY.a" and "nm"
> > 
> > Both these versions have symbol Z as "U"
> Is symbol Z defined in executable X?
> What specific error is the linker giving?
> What platform?
> -- 
> albert chin (address@hidden)

albert chin (address@hidden)

reply via email to

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