pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: G. Anthony Reina <reina@nsi.edu>
Cc: pgsql-sql@hub.org
Subject: Re: Postgres installed but my C programs won't compile
Date: Fri, 20 Nov 1998 09:50:05 -0500
Message-ID: <8783.911573405@sss.pgh.pa.us> (raw)
In-Reply-To: <199811200400.XAA27231@hub.org>

"G. Anthony Reina" <reina@nsi.edu> writes:
> I had no trouble installing Postgres 6.4 on my RedHat 5.1 Linux machine.
> However, the C programs I had previously written to access the SQL
> database were not returning the correct values. I tried to make some
> changes and re-compile the program but got the following error when I
> tried to run the re-compiled program:
> libpq.so.2.0: cannot open shared object file: No such file or directory
> It looks as though SQL can't find my shared libraries for Postgres
> anymore. Does anybody know why?

You may need to re-run ldconfig, or something like that, to get the
system to know where that library is.  This is pretty OS-dependent,
but there is some generic advice in the INSTALL instructions.
(BTW, if you find you can extend or improve on the INSTALL advice,
please send in better text...)

Things to check to try to debug this:

1. Does psql fire up for you, or does it fail with the same error?

2. You might try examining your executable with ldd to see if its shared
library dependency info looks reasonable.  (Assuming that psql works,
compare the output for psql.)

If all else fails, you can link libpq.a statically into your program
with an appropriate link-time switch (-Bstatic, I think, on Linux).
But it's better to get the sharedlib support working.

			regards, tom lane



view thread (3+ messages)

Message-ID: <8783.911573405@sss.pgh.pa.us>
Permalink:  ../8783.911573405@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8783.911573405@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, reina@nsi.edu, pgsql-sql@hub.org
  Subject: Re: Postgres installed but my C programs won't compile
  In-Reply-To: <8783.911573405@sss.pgh.pa.us>
  References: <199811200400.XAA27231@hub.org> <8783.911573405@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox