Linking Problem..

Surya Prakash
Wed Oct 3 04:19:00 GMT 2001


I have installed gcc cross compiler for m68k target. I have used
Binutils 2.10.1,  gcc 2.95.2 ,  Newlib 1.9.0,  Insight 5.0
Installation went on fine.   But I am having problems in linking a
simple '.c'  file  like

int main(void)
    printf("\n  Hello World");

while linking it gives the following errors..

1. undefined reference to '__main'
2 . undefined reference to 'printf'

I am getting these errors only for all library functions and the main. I
am compiling and linking with the following options

m68k-coff-gcc -mcpu32 -c -Wall hello.c
m68k-coff-ld  hello.o -o  hello.out

Why the library routines are not getting linked ? Am I need to do it
explicitly in the linker command ?
Or was there a problem in installation ?

Hoping any sort of help.....

Thanks and Regards

Want more information?  See the CrossGCC FAQ,
Want to unsubscribe? Send a note to

More information about the crossgcc mailing list