This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Re: Linking always generates _dl undefines
- To: Dan Christian <robodan@netscape.com>
- Subject: Re: Linking always generates _dl undefines
- From: Zack Weinberg <zack@rabi.columbia.edu>
- Date: Tue, 15 Sep 1998 22:32:21 -0400
- cc: libc-alpha@gnu.org
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