Getting Started with gcc

Alexandre Oliva aoliva@redhat.com
Sat Sep 29 01:54:00 GMT 2001


On Sep 21, 2001, John Kennedy <johnkennedy@allentek.com> wrote:

> I though ld would come with the package.

Nope.  gcc is a compiler collection.  The assembler and the linker are
part of GNU binutils, a separate project.

>     gcc -c myprog.c
>     ld myprog.o

> It gives my the familiar error that it can't find printf.

You should get the C library linked in, with -lc.  But you should
really get gcc to find ld, because then it will not only do this for
you, but will also link in its own support libraries and object files,
without which you may run into further problems.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-bugs mailing list