This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linking always generates _dl undefines


On Tue, 15 Sep 1998 17:36:15 -0700, Dan Christian wrote:
>
>egcs -o hello -O -I/usr/local/include hello.c -L/usr/local/lib 
>/usr/local/lib/libc.so.6: undefined reference to `_dl_profile_output'
>/usr/local/lib/libc.so.6: undefined reference to `__libc_stack_end'
[...]

You need to link your program like this:

egcs -o hello -O -I/usr/local/include hello.c -B/usr/local/lib/ \
	-Wl,-dynamic-linker,/usr/local/lib/ld-linux.so.2 \
	ld-linux.so.2

>Also, linking with -static will generate an executable that always
>core dumps.

In this case you need to do it like this:

egcs -static -o hello hello.c -I/usr/local/include -B/usr/local/lib/

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]