This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

Re: Bug with library link


> 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


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