pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedPostgres installed but my C programs won't compile
3+ messages / 3 participants
[nested] [flat]
* Postgres installed but my C programs won't compile
@ 1998-11-19 22:11 G. Anthony Reina <reina@nsi.edu>
1998-11-20 07:28 ` Re: [SQL] Postgres installed but my C programs won't compile Oliver Elphick <olly@lfix.co.uk>
0 siblings, 1 reply; 3+ messages in thread
From: G. Anthony Reina @ 1998-11-19 22:11 UTC (permalink / raw)
To: pgsql-sql
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:
[reina ~/c_programs]$ cc process_kinematics.c -o PROCESS_KINEMATICS $SQL
matrix_tools.c gcvspl.o -lm
[reina ~/c_programs]$ PROCESS_KINEMATICS
PROCESS_KINEMATICS: error in loading shared libraries
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?
I tried copying my 6.3.2 version back into the proper directories and
the program will compile and re-run correctly.
Anyone know what to do?
Thanks.
-Tony
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [SQL] Postgres installed but my C programs won't compile
1998-11-19 22:11 Postgres installed but my C programs won't compile G. Anthony Reina <reina@nsi.edu>
@ 1998-11-20 07:28 ` Oliver Elphick <olly@lfix.co.uk>
0 siblings, 0 replies; 3+ messages in thread
From: Oliver Elphick @ 1998-11-20 07:28 UTC (permalink / raw)
To: G. Anthony Reina <reina@nsi.edu>; +Cc: pgsql-sql
"G. Anthony Reina" wrote:
>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:
>
>[reina ~/c_programs]$ cc process_kinematics.c -o PROCESS_KINEMATICS $SQL
>matrix_tools.c gcvspl.o -lm
>[reina ~/c_programs]$ PROCESS_KINEMATICS
>PROCESS_KINEMATICS: error in loading shared libraries
>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?
>
>I tried copying my 6.3.2 version back into the proper directories and
>the program will compile and re-run correctly.
The library version number changed at 6.4. If your 6.3.2 was from an
rpm and you have compiled this one for yourself, it is possible that the
libraries have ended up in different places. On Debian, packages
put libraries in /usr/lib, for example, whereas, by default, PostgreSQL
install puts them in /usr/local/lib.
Try adding -l/usr/local/lib to the compile line.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"If my people, which are called by my name, shall
humble themselves, and pray, and seek my face, and
turn from their wicked ways; then will I hear from
heaven, and will forgive their sin, and will heal
their land." II Chronicles 7:14
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Postgres installed but my C programs won't compile
@ 1998-11-20 14:50 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 1998-11-20 14:50 UTC (permalink / raw)
To: G. Anthony Reina <reina@nsi.edu>; +Cc: pgsql-sql@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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1998-11-20 14:50 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-11-19 22:11 Postgres installed but my C programs won't compile G. Anthony Reina <reina@nsi.edu>
1998-11-20 07:28 ` Oliver Elphick <olly@lfix.co.uk>
1998-11-20 14:50 Re: Postgres installed but my C programs won't compile Tom Lane <tgl@sss.pgh.pa.us>
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