Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* How to link a library file
@ 1996-05-28  4:00 David Phan
  1996-05-29  4:00 ` Torsten Robert Kirschner
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Phan @ 1996-05-28  4:00 UTC (permalink / raw)



I tried to link the library file /usr/local/sql/lib/libsql.a to a
C program myprog.c with the following command and got error messages:

   cc /usr/local/sql/lib/libsql.a myprog.c

(myprog.c calls a function in libsql.a.)
Can anyone tell me what I did wrong? Thanks in advance.


-- 
|o|   David Phan           Email: dphan@comsource.net        |o|
|o|   ComSource, Inc.      URL: http://www.comsource.net     |o|
|o|   101 Plaza East Blvd. Suite 316, Evansville, IN 47715   |o|
|o|   Voice: 812.469.0300  Fax: 812.469.0317                 |o|



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to link a library file
  1996-05-28  4:00 How to link a library file David Phan
@ 1996-05-29  4:00 ` Torsten Robert Kirschner
  1996-06-04  4:00   ` Simon Wright
  1996-05-29  4:00 ` Torsten Robert Kirschner
  1996-06-03  4:00 ` Jonathan ben-Avraham (Tivoli)
  2 siblings, 1 reply; 5+ messages in thread
From: Torsten Robert Kirschner @ 1996-05-29  4:00 UTC (permalink / raw)



>>>>> "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.

	c u
		T.
--
Torsten Robert Kirschner                            torstenk@ifi.uio.no
torki@mpipf-muenchen.mpg.de  http://www.ifi.uio.no/~torstenk/index.html




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to link a library file
  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-03  4:00 ` Jonathan ben-Avraham (Tivoli)
  2 siblings, 0 replies; 5+ messages in thread
From: Torsten Robert Kirschner @ 1996-05-29  4:00 UTC (permalink / raw)



>>>>> "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  myprog.c -lsql

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.

	c u
		T.
--
Torsten Robert Kirschner                            torstenk@ifi.uio.no
torki@mpipf-muenchen.mpg.de  http://www.ifi.uio.no/~torstenk/index.html




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to link a library file
  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-03  4:00 ` Jonathan ben-Avraham (Tivoli)
  2 siblings, 0 replies; 5+ messages in thread
From: Jonathan ben-Avraham (Tivoli) @ 1996-06-03  4:00 UTC (permalink / raw)



David Phan (dphan@alpha.comsource.net) wrote:
: I tried to link the library file /usr/local/sql/lib/libsql.a to a
: C program myprog.c with the following command and got error messages:
: 
:    cc /usr/local/sql/lib/libsql.a myprog.c
: 
: (myprog.c calls a function in libsql.a.)
: Can anyone tell me what I did wrong? Thanks in advance.
: 
: 
: -- 
: |o|   David Phan           Email: dphan@comsource.net        |o|
: |o|   ComSource, Inc.      URL: http://www.comsource.net     |o|
: |o|   101 Plaza East Blvd. Suite 316, Evansville, IN 47715   |o|
: |o|   Voice: 812.469.0300  Fax: 812.469.0317                 |o|

David,
What version of what compiler are you using? What was the error message?
What does your code do? Why do you make us play "twenty questions"?

 - yba
    
     TclTek Ltd.     "Don't laugh, we're serious!"        ~. .~
 =}----------------------------------------------------ooO--U--Ooo------{=
 - benavrhm@tcltek.co.il - tel: +972.52.670.353, http://www.tcltek.co.il -



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to link a library file
  1996-05-29  4:00 ` Torsten Robert Kirschner
@ 1996-06-04  4:00   ` Simon Wright
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Wright @ 1996-06-04  4:00 UTC (permalink / raw)



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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-06-04  4:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-28  4:00 How to link a library file David Phan
1996-05-29  4:00 ` Torsten Robert Kirschner
1996-06-04  4:00   ` Simon Wright
1996-05-29  4:00 ` Torsten Robert Kirschner
1996-06-03  4:00 ` Jonathan ben-Avraham (Tivoli)

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