Path: utzoo!attcan!uunet!lll-winken!ames!sgi!davea@quasar.wpd.sgi.com From: davea@quasar.wpd.sgi.com (David B. Anderson) Newsgroups: comp.sys.sgi Subject: Re: ar - the archiver Message-ID: <52318@sgi.sgi.com> Date: 1 Mar 90 17:11:32 GMT References: <9002281129.aa20377@SMOKE.BRL.MIL> Sender: davea@quasar.wpd.sgi.com Reply-To: davea@quasar.UUCP (David B. Anderson) Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 27 In article <9002281129.aa20377@SMOKE.BRL.MIL> JORDAN@gmr.COM writes: >Can someone give me any tips on using ar, or lead me to any books that >might be able to help me. > >I am able to create a library, add objects, and update symbol tables >(e.g. ar cr lib.a a.o b.o, or ar ts lib.a), BUT I would like the compilerr >to recognize it via a flag; for example, the way it recognizes -Zg, or -lgl_s. This is easily done. Say you name your archive libmy.a and have a copy temporarily in /myliblocation. su # need to be root for the cp to /usr/lib cp /myliblocation/libmy.a /usr/lib exit # no need to be root any more cc t.c -lmy #this works, since ld searches /usr/lib # alternatively: mkdir /usr/local/lib cp /myliblocation/libmy.a /usr/local/lib cc t.c -L/usr/local/lib -lmy # the -Lpath adds the path to the ld search list You'll find all this information via ``man ld'' As always, RTFM :-) Regards, [ David B. Anderson Silicon Graphics (415)335-1548 davea@sgi.com ]