Sender: owner-postgres95@postgres.Berkeley.EDU
X-Return-Path: andrew_yu
Received: from methi.ndim.edrc.cmu.edu (METHI.NDIM.EDRC.CMU.EDU [128.2.214.230]) by nobozo.CS.Berkeley.EDU (8.6.10/8.6.3) with SMTP id XAA16400 for <postgres95@nobozo.cs.berkeley.edu>; Thu, 2 Nov 1995 23:59:05 -0800
Message-Id: <199511030759.XAA16400@nobozo.CS.Berkeley.EDU>
Received: from localhost by methi.ndim.edrc.cmu.edu id aa01806;
          3 Nov 95 2:58 EST
X-Mailer: exmh version 1.6.2 7/18/95
To: Peter Hlivka <lincoln!hlivka@netcom.com>,
    postgres95@postgres.Berkeley.EDU
cc: hlivka@zexel.com
Reply-to: rp2y+@CS.cmu.edu
Subject: Re: linking with the libpq library 
References: <9511030113.AA07892@ZEXEL> 
In-reply-to: Your message of "Thu, 02 Nov 1995 17:13:25 PST."
             <9511030113.AA07892@ZEXEL> 
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Date: Fri, 03 Nov 1995 02:58:46 -0500
From: Robert Patrick <Robert_Patrick@methi.ndim.edrc.cmu.edu>
Resent-To: postgres95-redist
Resent-Date: Thu, 02 Nov 95 23:59:06 -0800
Resent-From: pglite
Resent-XMts: smtp

> HELP!-when I try to link libpq.a I get the error ld: -llibpq.a:expected libx.so(.major.minor.xxx).  If someone knows the problem I would appreciate hearing from them.  The script used to compile my frontend program is listed below.
> 
> gcc -I/db_work/hlivka/usr/local/postgres95/include -L/db_work/hlivka/usr/local/postgres95/lib -llibpq.a t1.c

How about this???:

% gcc -I/db_work/hlivka/usr/local/postgres95/include -L/db_work/hlivka/usr/local/postgres95/lib t1.c -lpq

If you would look at the man page for gcc, you would realize that any -lfoo inserts the "lib" and ".a" around the argument to -lfoo (i.e., -lfoo == libfoo.a).  Also, if t1.c includes function calls that are defined in libpq.a, libpq.a must follow t1.c in the compile line!

If you insist on using libpq.a, do it this way:

% gcc -I/db_work/hlivka/usr/local/postgres95/include t1.c /db_work/hlivka/usr/local/postgres95/lib/libpq.a

Robert



===============================================================================
  To unsubscribe from the Postgres95 mailing list, send mail with the subject
  line "DEL" to "postgres95-request@postgres.Berkeley.EDU". 
============  URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres95/  ===========
