Help! Newbie problem

Jeff Sciortino jjs2815@rit.edu
Tue Nov 16 08:59:00 GMT 1999


When I try to compile hello world form K&R I get the error:

bash-2.01$ gcc hello.c
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x36): undefined reference to `main'
collect2: ld returned 1 exit status

I'm running 2.95.2 on debian 2.1. I didn't build gcc on my machine, I
downloaded the debs and installed it.

I _think_ I installed all the requisite libraries, do I need an
environment variable that I'm missing?

I've also tried to compile a sample objective C program, and got the
following errors:

/tmp/ccNO7eLj.o: In function `main':
/tmp/ccNO7eLj.o(.text+0x28): undefined reference to `objc_get_class'
/tmp/ccNO7eLj.o(.text+0x33): undefined reference to `objc_msg_lookup'
/tmp/ccNO7eLj.o(.text+0x4b): undefined reference to `objc_msg_lookup'
/tmp/ccNO7eLj.o(.text+0x74): undefined reference to `objc_msg_lookup'
/tmp/ccNO7eLj.o(.text+0xa3): undefined reference to `objc_msg_lookup'
/tmp/ccNO7eLj.o(.text+0xd0): undefined reference to `objc_msg_lookup'
/tmp/ccNO7eLj.o: In function `global constructors keyed to main':
/tmp/ccNO7eLj.o(.text+0xff): undefined reference to `__objc_exec_class'
/tmp/ccMyRVhk.o: In function `_i_Printer__init':
/tmp/ccMyRVhk.o(.text+0x26): undefined reference to
`objc_msg_lookup_super'
/tmp/ccMyRVhk.o(.text+0x4d): undefined reference to `objc_msg_lookup'
/tmp/ccMyRVhk.o: In function `_i_Printer__print':
/tmp/ccMyRVhk.o(.text+0xc6): undefined reference to `objc_msg_lookup'
/tmp/ccMyRVhk.o: In function `global constructors keyed to
Printer.mqFe2Da':
/tmp/ccMyRVhk.o(.text+0x123): undefined reference to `__objc_exec_class'
/tmp/ccMyRVhk.o(.rodata+0x8): undefined reference to
`__objc_class_name_Object'
collect2: ld returned 1 exit status

Thanks much for any light anyone can shed.

If you need more info to get a better handle on it, let me know.

Regards,

Jeff

-- 

To try many things and succeed in a few is success.

      				-Elbert Hubbard


More information about the Gcc-help mailing list