Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: simon.j.wright@gecm.com (Simon Wright)
Subject: Re: How to link a library file
Date: 1996/06/04	[thread overview]
Message-ID: <SIMON.J.WRIGHT.96Jun4183622@luthien.frlngtn.gmcs.gecm.com> (raw)
In-Reply-To: 4oi7d8$rle@glitnir.ifi.uio.no


In article <4oi7d8$rle@glitnir.ifi.uio.no> torstenk@ifi.uio.no (Torsten Robert Kirschner) writes:

> >>>>> "DP" == David Phan <dphan@alpha.comsource.net> writes:
> In article <4ofqqd$alm@alpha.comsource.net> dphan@alpha.comsource.net (David Phan) writes:
> DP> I tried to link the library file /usr/local/sql/lib/libsql.a to a
> DP> C program myprog.c with the following command and got error messages:
> DP> cc /usr/local/sql/lib/libsql.a myprog.c
> 
> I'd suggest:
> 
> 	cc -L/usr/local/sql/lib -lsql myprog.c
> 
> In general, a look at cc's man page might be a good idea. Also, if you
> need header files, you might  have to add a -I/usr/local/sql/include.

True-ish.

Your version should be
	cc myprog.c -L/usr/local/sql/lib -lsql

David's version should be
	cc myprog.c /usr/local/sql/lib/libsql.a

(the linker doesn't know what it needs from libsql.a until it's read
myprog.o).

-- 
Simon Wright                                          (G-net) +842-1778
Ferranti Naval Systems                        (voice) +44(0)1705-701778
GEC-Marconi S3I Combat Systems Division         (fax) +44(0)1705-701800



  reply	other threads:[~1996-06-04  4:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-28  4:00 How to link a library file David Phan
1996-05-29  4:00 ` Torsten Robert Kirschner
1996-05-29  4:00 ` Torsten Robert Kirschner
1996-06-04  4:00   ` Simon Wright [this message]
1996-06-03  4:00 ` Jonathan ben-Avraham (Tivoli)
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox