tango and gdc
Lars Noschinski
lars-2006-1 at usenet.noschinski.de
Fri Aug 17 11:05:06 PDT 2007
* Lars Noschinski <lars-2006-1 at usenet.noschinski.de> [07-08-17 19:28]:
>Bud does not build with Tango, so I tried rebuild. It works, but builds
>a lot of object files, probably one for each Tango class used. This is
>somehow annoying and I wonder, if there should not a precompiled binary?
>
>I installed Tango/GDC via the tango+gdc installer from the tango
>website in /usr/local.
Hm, the order of arguments to matters:
% gdc -I /usr/local/include -fversion=Posix dzen-status.d -lgtango
works, but
% gdc -I /usr/local/include -fversion=Posix -lgtango dzen-status.d
fails with undefined references:
/tmp/ccWAFn0z.o: In function `_Dmain':
dzen-status.d:(.text+0x54): undefined reference to `_D5tango3sys7Process7Process7__ClassZ'
dzen-status.d:(.text+0x6f): undefined reference to `_D5tango3sys7Process7Process5_ctorMFAAaXC5tango3sys7Process7Process'
dzen-status.d:(.text+0xdd): undefined reference to `_D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print'
dzen-status.d:(.text+0x103): undefined reference to `_D5tango2io5Print12__T5PrintTaZ5Print8formatlnMFAaYC5tango2io5Print12__T5PrintTaZ5Print'
/tmp/ccWAFn0z.o:(.data+0x34): undefined reference to `_D5tango2io6Stdout12__ModuleInfoZ'
/tmp/ccWAFn0z.o:(.data+0x38): undefined reference to `_D5tango3sys7Process12__ModuleInfoZ'
collect2: ld returned 1 exit status
This is actually documented in the gcc documentation, but did not occur
to me yesterday, so I failed to link against libgtango:
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.
More information about the Digitalmars-d-learn
mailing list