Re: GTK+ library access issue?



Il giorno mar, 25/10/2011 alle 07.10 -0700, David Buchan ha scritto:
> Hi Nicola, 
> 
> I did find this on the GNU gcc page:
> "-l library
> It makes a difference where in the command you write this option; the
> linker searches and processes libraries and object files in the order
> they are specified. Thus, `foo.o -lz bar.o' searches library `z' after
> file foo.o but before bar.o. If bar.o refers to functions in `z',
> those functions may not be loaded."
> 
> http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
> 
> Seems to confirm it. Interesting.
> I guess the previous gcc was a bit more forgiving for my sloppy ways.
> 
Maybe you can find this link interesting ;-)
https://wiki.ubuntu.com/NattyNarwhal/ToolchainTransition

The changes it describes have been implemented only in Oneiric

> Dave
> 
> 
> ______________________________________________________________________
> From: Nicola Fontana <nicola entidi gmail com>
> To: David Buchan <pdbuchan yahoo com>
> Cc: David Nečas <yeti physics muni cz>; "gtk-list gnome org"
> <gtk-list gnome org>
> Sent: Tuesday, October 25, 2011 8:06 AM
> Subject: Re: GTK+ library access issue?
> 
> Il giorno lun, 24/10/2011 alle 17.59 -0700, David Buchan ha scritto:
> > Interesting. I just tried compiling a simple non-gtk c program:
> > 
> > 
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <math.h>
> > 
> > int
> > main()
> > {
> >  int i;
> >  double a =3.14;
> >  double c;
> > 
> >  c = log(a);
> > 
> >  c = pow(a, i);
> > 
> > }
> > 
> > 
> > 
> > 
> > $ gcc -lm test.c
> > /tmp/cc9RccRJ.o: In function `main':
> > test.c:(.text+0x1b): undefined reference to `log'
> > test.c:(.text+0x33): undefined reference to `pow'
> > collect2: ld returned 1 exit status
> 
> Try "gcc test.c -lm": I found the object order is important on recent
> Ubuntu. Not sure is gcc or ubuntu related.
> 
> With autotools I had to move the libs flags in LDADD instead of
> LDFLAGS.
> 
> Ciao.
> -- 
> Nicola
> 
> 
> 
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list




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