Library and linker errors

Alexandre Oliva aoliva@redhat.com
Wed Aug 2 16:33:00 GMT 2000


On Aug  2, 2000, "Russ.Shaw" <russell@webaxs.net> wrote:

> I can't find where __umodsi3 etc are defined. In my makefile, i'm
> linking ld using -lgcc -liberty -lg -lc -lm.

You've got the order of libraries all wrong.  The order is important
because the linker only scans each library once.  Besides, I have the
impression that libg.a is just libc.a with debugging symbols.

Move -lm before -lc, then put -lgcc before *and* after -lc.

When in doubt, use gcc for linking, since it already does the right
thing regarding -lc and -lgcc.

-- 
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-help mailing list