Hello help wanted asap for this one please.
I have installed POstgres on my own machine and i am
in charge of its settings.

the problem is when i try and run a small piece of c
code i get an error which states the following:
cc  testing_connection.c  -L/usr/local/pgsql/lib -lpq 
-I/usr/local/pgsql/include -o fred -O0  
$ ./fred
./fred: error in loading shared libraries: libpq.so.2:
cannot open shared object file: No such file or
directory


the program followed all the steps set out in the
postgres documentation on building Libpq programs.
But i still get the above??
Any suggestions please

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

Tue, 5 Mar 2002 03:26:46 -0800 (PST)
Pa O'Clerigh <switswoo79@yahoo.com>
Help Wanted for running C code
Hi,

You should probably post this on -general or some other list, but I believe
the answer is that the postgres libraries cannot be found by the dynamic
library loader. You can fix this by:

* Including the PGINSTALLDIR/lib directory in your LD_LIBRARY_PATH

or

* Editing your /etc/ld.so.conf to include the above path and running
ldconfig

or

* symlinking from an existing library path (/usr/lib etc) to this file.

Regards,

Mark

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org
> [mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Pa O'Clerigh
> Sent: Tuesday, 5 March 2002 10:27 PM
> To: pgsql-hackers@postgresql.org
> Subject: [HACKERS] Help Wanted for running C code
>
>
> Hello help wanted asap for this one please.
> I have installed POstgres on my own machine and i am
> in charge of its settings.
>
> the problem is when i try and run a small piece of c
> code i get an error which states the following:
> cc  testing_connection.c  -L/usr/local/pgsql/lib -lpq
> -I/usr/local/pgsql/include -o fred -O0
> $ ./fred
> ./fred: error in loading shared libraries: libpq.so.2:
> cannot open shared object file: No such file or
> directory
>
>
> the program followed all the steps set out in the
> postgres documentation on building Libpq programs.
> But i still get the above??
> Any suggestions please
>
> __________________________________________________
> Do You Yahoo!?
> Try FREE Yahoo! Mail - the world's greatest free email!
> http://mail.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>


Wed, 13 Mar 2002 11:07:53 +1100
"Mark Pritchard" <mark@tangent.net.au>
Re: Help Wanted for running C code
On Tue, Mar 05, 2002 at 03:26:46AM -0800, Pa O'Clerigh wrote:
... 
> the problem is when i try and run a small piece of c
> code i get an error which states the following:
> cc  testing_connection.c  -L/usr/local/pgsql/lib -lpq 
> -I/usr/local/pgsql/include -o fred -O0  
> $ ./fred
> ./fred: error in loading shared libraries: libpq.so.2:
> cannot open shared object file: No such file or
> directory
...

What does

   ldd fred
   file fred

tell you? Maybe

   cc testing_connection -L/usr/local/pgsql/lib -Wl,-R/usr/local/pgsql/lib -lpq\
     -I/usr/local/pgsql/include -o fred -O0

?

Patrick

Wed, 13 Mar 2002 00:10:12 +0000
Patrick Welche <prlw1@newn.cam.ac.uk>
Re: Help Wanted for running C code
Pa O'Clerigh writes:

> the problem is when i try and run a small piece of c
> code i get an error which states the following:
> cc  testing_connection.c  -L/usr/local/pgsql/lib -lpq
> -I/usr/local/pgsql/include -o fred -O0
> $ ./fred
> ./fred: error in loading shared libraries: libpq.so.2:
> cannot open shared object file: No such file or
> directory

Add -Wl,-rpath,/usr/local/pgsql/lib, or set and export
LD_LIBRARY_PATH=/usr/local/psgql/lib, or modify /etc/ld.so.conf and run
ldconfig.

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 12 Mar 2002 19:36:10 -0500 (EST)
Peter Eisentraut <peter_e@gmx.net>
Re: Help Wanted for running C code