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

See the CrossGCC FAQ for lots more infromation.


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

Re: Linker problem?



-lc is the option that tells the linker to tie in the libc (or newlib)
library.  You are probably using printf which is in this library.  Your
linker doesn't know where to find your libc.a archive, so you will
have to give it a -L option to let it know what the library path is.

This is assuming that you installed newlib (it is separate from gcc),
if you haven't that is your problem.

Noah.

On 5 Oct 2000, at 14:55, Torbjørn Heltne wrote:

> Hello list members!
>
> I'm pretty new to this... but I have followed the instructions on
> http://sources.redhat.com/ecos/tools/linux-arm-elf.html to install,
> configure and build the arm-elf-gcc and friends.
>
> It went pretty smooth except that I had to use LANGUAGES="c" under "Build
> and install GCC". Don't think that causes my problem though... :-)
>
> Anyway: trying to build the well-known "hello, world!" I bump into a
> problem. Seen this one before, anyone?
>
> [etotorh@eto00840 ]$ make
> arm-elf-gcc -O2   -c -o hello.o hello.c
> arm-elf-gcc -o hello.elf startup.o syscalls.o hello.o -nostartfiles \
>   -Wl,-Ttext,0,-Tdata,0x300000
> /tools/H-i686-pc-linux-gnu/arm-elf/bin/ld: cannot find -lc
> collect2: ld returned 1 exit status
> make: *** [hello.elf] Error 1
> [etotorh@eto00840 ]$
>
> What's this "-lc" that the linker can't find?
>
> --
> Torbjørn Heltne
>
>
> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com



------------------------------------------
Noah Aklilu
http://www.ee.ualberta.ca/~aklilu/
naklilu@ualberta.ca

------
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]