using libraries with ld (1)

Guy Harris guy at sun.uucp
Sat Aug 10 19:23:05 AEST 1985


> > Some versions of "ld" support the "-Llibpath" option to specify an
> > additional directory to search for libraries.
> > 
> > You can always just name the library in the "ld" or "cc" command:
> > 	cc -o myprog myprog.o mysub.o mylib.a -lm -lplot
> 
> I was under the impression that libraries specified in the way that mylib.a
> is have the entire library linked in rather than just those routines which
> are needed because of undefined identifiers.  Does anyone know if this is
> actually the case?

It is absolutely not the case.  "ld" distinguishes object files from
libraries by their contents (to be specific, by the header that archive
files such as libraries have), not by the syntax used to specify them.

	Guy Harris



More information about the Comp.unix mailing list