using libraries with ld(1)

BALDWIN mike at whuxl.UUCP
Thu Aug 15 07:34:50 AEST 1985


> 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!)

On SVR2 you can use -L on the cc command line without -Wl, e.g.:
	cc -o foo foo.c -L/usr/jrandom/lib -lglarch
-- 
						Michael Baldwin
						AT&T Bell Labs
						harpo!whuxl!mike



More information about the Comp.unix mailing list