Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!sgi!shinobu!odin!bananapc.wpd.sgi.com!ciemo From: ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) Newsgroups: comp.sys.sgi Subject: Re: ar - the archiver Message-ID: <4759@odin.SGI.COM> Date: 1 Mar 90 17:34:40 GMT References: <9002281129.aa20377@SMOKE.BRL.MIL> Sender: news@odin.SGI.COM Reply-To: ciemo@bananapc.wpd.sgi.com (Dave Ciemiewicz) Organization: Silicon Graphics, Inc. Lines: 31 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. > > Thanks for any help... > > tp mugabi-jordan > gm systems engr ctr When you specify a library using -l, the linker, ld, looks for the file as /lib/lib.a or as /usr/lib/lib.a. For instance, by specifying -lgl_s, you are actually getting /usr/lib/libgl_s.a. You can specify additional library search paths by using -L where is the directory containing your library (even . if you want). If you wanted to look up a libraries in /usr/local/lib, for instance, you could add to your cc or ld command line: -L/usr/local/lib -lmylib1 -lmylib2 and the libraries could actually be /usr/local/lib/libmylib1.a and /usr/local/lib/mylib2.a. See cc(1) and ld(1) for more details. --- Ciemo