Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!utcs!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.unix Subject: Re: using libraries with ld (1) Message-ID: <750@lsuc.UUCP> Date: Mon, 12-Aug-85 15:51:20 EDT Article-I.D.: lsuc.750 Posted: Mon Aug 12 15:51:20 1985 Date-Received: Mon, 12-Aug-85 16:29:40 EDT References: <240@cmu-cs-h.ARPA> Reply-To: dave@lsuc.UUCP (David Sherman) Organization: Law Society of Upper Canada, Toronto Lines: 21 Summary: you're thinking of cc ... file.o In article <240@cmu-cs-h.ARPA> rfb@cmu-cs-h.ARPA (Rick Busdiecker) writes: >> 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? No, it's not the case. What you're probably thinking of is what happens with "mysub.o" in the above example. All routines in mysub.o will indeed get linked into your binary; the files in mylib.a will only be taken as needed. Of course, once you take any .o file (whether on the command line or from a .a archive), you get ALL the routines in that file whether you want them or not. Dave Sherman The Law Society of Upper Canada Toronto -- { ihnp4!utzoo pesnta utcs hcr decvax!utcsri } !lsuc!dave