Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site lzwi.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!dual!qantel!ihnp4!lzwi!psc From: psc@lzwi.UUCP (Paul S. R. Chisholm) Newsgroups: net.unix Subject: Re: using libraries with ld(1) Message-ID: <243@lzwi.UUCP> Date: Mon, 12-Aug-85 22:21:29 EDT Article-I.D.: lzwi.243 Posted: Mon Aug 12 22:21:29 1985 Date-Received: Sun, 18-Aug-85 22:27:57 EDT References: <125@shell.UUCP> Distribution: net Organization: AT&T-IS Enhanced Network Services Lines: 23 Summary: ld -L/usr/jrandom/lib In article <125@shell.UUCP>, buck@shell.UUCP (Lester Buck) writes: > I have a private library of C routines which I want to link into various > programs. The loader ld(1) *insists* on searching only /lib/lib*.a, > /usr/lib/lib*.a, /usr/local/lib/lib*.a and then gives up. > > Ok, what am I missing? Well, in System V ld(1) has a -L option, followed by the name of a directory to be searched before /lib and /usr/lib. Usage cc -c foo.c && ld -o foo -L/usr/jrandom/lib -lglarch -lc or cc -o foo foo.c -Wl,-L/usr/jrandom/lib -lglarch (-Wl can be used to pass arguments to the linker from cc(1); there were so many options to each, cc could no longer just assume all linker commands were unrecognized and vice versa, and don't flame at me for it!) Note for Unix history buffs: this feature wasn't in System III, so it's quite recent. -Paul S. R. Chisholm The above opinions are my own, {pegasus,vax135}!lzwi!psc not necessarily those of any {mtgzz,ihnp4}!lznv!psc telecommunications company. (*sigh* ihnp4!lzwi!psc does *NOT* work!!! Use above paths.) "Of *course* it's the murder weapon. Who would frame someone with a fake?"