MIPS Cross Compiler

Ken Rose kenr@vmlabs.com
Fri Oct 12 16:26:00 GMT 2001

On 12-Oct-01, Matt Welsford wrote:
>Using the following invocation of the compiler:
>       $ mips-elf-gcc main.c crt0.S -nostdlib -I../include
>I get the following error:
>/cygdrive/c/WINNT/TEMP/ccEsdqTG.o: In function `main':
>main.c(.text+0xc): undefined reference to `__main'

It's the -nostdlib that's getting you.  __main is defined in libgcc.a, and
--nostdlib tells the compiler to omit that from the link.  Depending on the
target, __main will run constructors and the like.

Hope that helps,

 - ken

Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

More information about the crossgcc mailing list