ar - the archiver

Dave Ciemiewicz ciemo at bananapc.wpd.sgi.com
Fri Mar 2 04:34:40 AEST 1990


In article <9002281129.aa20377 at SMOKE.BRL.MIL>, JORDAN at 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<libsuffix>, the linker, ld, looks for the
file as /lib/lib<libsuffix>.a or as /usr/lib/lib<libsuffix>.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<libdirectory> where
<libdirectory> 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



More information about the Comp.sys.sgi mailing list