Bug with library link

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri Dec 31 20:54:00 GMT 1999


> I think -- this is feature, not bug, but may be...

This is not a bug. The Unix linker worked that way from day one.

> I create my own lib and try to link it with option -l. But when -lmy_lib
> stay before my_soure.o, gcc can't find functions in libmy_lib.a that is
> using in my_source.c.
> 
> When -lmy_lib stay after my_source.o -- it links succesfully.

A library is searched for missing symbols. Objects and libraries are
processed from left to right. When no symbol is missing, the library
is not used.

Regards,
Martin



More information about the Gcc-bugs mailing list