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

Re: gcc can't compile, egcc can!??



On Sat, 13 Jun 1998 22:51:30 -0500 (CDT), servis@purdue.edu wrote:
>On 13 Jun, Zack Weinberg wrote:
>> What do you get if you do this:
>> 
>> gcc -v -o hello hello.c
>
>This is what I get:
>
>% gcc -v -o hello hello.c
>gcc version 2.7.2.3
[...]
> ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o hello
> /usr/lib/crt1.o /usr/lib/crti.o
> /usr/lib/gcc-lib/i486-linux/2.7.2.3/crtbegin.o
> -L/usr/lib/gcc-lib/i486-linux/2.7.2.3 /tmp/ccd01600 -lgcc -lc -lgcc
> /usr/lib/gcc-lib/i486-linux/2.7.2.3/crtend.o /usr/lib/crtn.o
>/usr/lib/crt1.o(.text+0xe): undefined reference to `__libc_init_first'
>/usr/lib/crt1.o(.text+0x18): undefined reference to `_environ'

Hunh.  It is pulling in the C library (-lc).  Next thing is to see
what egcc and/or g++ do differently; can you try the same thing with
either of them?  (I only need to see the link line, so you could do

gcc -c hello.c

egcc -v -o hello hello.o
g++ -v -o hello hello.o

to cut down on the noise a little.)

Also, another thing that might possibly produce this error is if
/usr/lib/libc.so is mangled.  Can you check that that's an ordinary
file containing something like

GROUP { libc.so.6 ld-linux.so.2 libc.a }

please?  It ought to affect both compilers if that's wrong, but it's
worth checking. 

zw


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: