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

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "G(dot) Anthony Reina" <reina(at)nsi(dot)edu>
Cc: "pgsql-questions(at)postgresql(dot)org" <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Postgres installed but my C programs won't compile
Date: 1998-11-20 07:28:58
Message-ID: 199811200728.HAA16476@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Elphick(at)lfix(dot)co(dot)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

Browse pgsql-sql by date

  From Date Subject
Next Message f.ermini 1998-11-20 13:08:18 How do I COPY empty Datetimes?
Previous Message Ulf Mehlig 1998-11-20 07:00:01 Re: [SQL] abs value, power, sqrt