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

Re: Problem compiling (gcc? glibc?)



On Fri, Jan 14, 2005 at 03:09:10PM +1300, Andrew Walbran wrote:
> On Fri, 14 Jan 2005 1:07 am, David wrote:
> > > On Thu, 6 Jan 2005 18:20:35 +1300, Andrew Walbran

> > > > I have recently started using Debian GNU / Linux, and have
> > > > found that I am unable to compile anything with GCC.
> > > > Compiling even a trivial program gives a number of
> > > > 'undefined reference' errors:
> > > >
> > > > /lib/libc.so.6: undefined reference to

[...]

> > > > Compiling with the -static flag succeeds without errors, but
> > > > this is not really a solution.

> > This sounds line it's in some way your ldconfig setup.
> Where should I start looking?

> > > > Do you by any chance have an environment variable "LD_LIBRARY_PATH"
> I tried this suggestion (removing all but /usr/X11R6/lib from /etc/ld.so.conf 
> and running ldconfig), but it makes no difference - I still get the same 
> error when compiling.
> I can't work out why ld.so is using /lib/tls rather than /lib. According to 
> the manpage for ld.so, it looks for shared libraries in LD_LIBRARY_PATH, then 
> those listed in /etc/ld.so.cache (created by ldconfig according 
> to /etc/ld.so.conf), and then in /usr/lib and /lib. None of these should 
> cause it to look in /lib/tls.
> 
> However, I have found that if I set LD_LIBRARY_PATH to _either_ /lib 
> or /lib/tls, gcc works fine and gives no errors. The resulting executable 
> links against /lib/tls/libc.so.6. Why would this be?

I really don't know.  Actually, I'd halfway overlooked the fact that
your errors are occurring _during_ your compilation.  But that does not
explain why _all_ your apps are pointing to /lib/tls.  I have only a
couple of other ideas.

1. Do you have an environment LIBRARY_PATH set?  Probably not.  I'd
   suppose that gcc is looking in /lib/tls because it's a SYSTEM thing.

2. Could it be a locales problem ?



Reply to: