This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Linking Problem..


Hi,

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

#include<stdio.h>
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
Surya






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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]