ld - lQuerry about ibrary linking.

Nick Clifton nickc@redhat.com
Tue Jan 28 11:49:00 GMT 2003

Hi Shrikar,

> Means if ld finds the library in search path it will get it and link
> it. But even if it doesnt find the archive in that path, as long as
> all the symbols are resolved, it should *not* give an error as *"Can
> not find -l<archive>"*.

There is no way to do this using the linker.  If you specify a library
name on the command line, and the library cannot be found, it is an
error and the linker will not produce an executable.

You will have to arrange not to pass the -l... option to the linker if
the library is not present.


More information about the Binutils mailing list