Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Creating libraries of object module Message-ID: <12233@smoke.BRL.MIL> Date: 24 Feb 90 22:54:21 GMT References: <34230@news.Think.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <34230@news.Think.COM> saroff@wotan.think.com.UUCP (steven saroff) writes: >How does one create personal libraries or archives of object modules to >like to. I want to have a library of various useful sub program, and >just link to them with a -l or something akin to it when I am compiling >some larger code. All that the "ld" or "cc" option "-lxxx" option does is to in effect expand in-line to the pathname /usr/lib/libxxx.a. You can always specify the pathname of any library archive that you wish to be searched at that point in the link-editing process. Such archives are created and maintained via the "ar" utility, which is described in the UNIX Programmer's Reference Manual. For example, cc -o foo foo.o foosubs.o mylib.a -lm