Re: Postgres installed but my C programs won't compile

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>
Cc: pgsql-sql(at)hub(dot)org
Subject: Re: Postgres installed but my C programs won't compile
Date: 1998-11-20 14:50:05
Message-ID: 8783.911573405@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"G. Anthony Reina" <reina(at)nsi(dot)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

Browse pgsql-sql by date

  From Date Subject
Next Message G.Elangovan 1998-11-20 18:20:19 unsubscribe pgsql-sql@postgreSQL.org
Previous Message f.ermini 1998-11-20 13:08:18 How do I COPY empty Datetimes?