Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.unix Subject: Re: using libraries with ld (1) Message-ID: <2596@sun.uucp> Date: Sat, 10-Aug-85 05:23:05 EDT Article-I.D.: sun.2596 Posted: Sat Aug 10 05:23:05 1985 Date-Received: Mon, 12-Aug-85 22:34:06 EDT References: <240@cmu-cs-h.ARPA> Organization: Sun Microsystems, Inc. Lines: 16 > > 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