Re: Can't not load libpq.so.3 - Mailing list pgsql-hackers

From Jeroen T. Vermeulen
Subject Re: Can't not load libpq.so.3
Date
Msg-id 20031024164131.GB12700@xs4all.nl
Whole thread Raw
In response to Can't not load libpq.so.3  ("Fabien DAUMEN" <fdaumen@technodiva.com>)
List pgsql-hackers
On Mon, Oct 20, 2003 at 10:12:28AM +0200, Fabien DAUMEN wrote:
> 
> I link my program with this link option ?L/usr/local/pgsql/lib.
That's good, but it only deals with the compile-time linking.  The
actual loading of a shared library happens at run-time, and since there's
no special reason to assume that the running system will look like the
one you compiled your code on, this library path is not remembered.

So libpq needs to be in your library *load* path as well as your library
*link* path, which you set correctly.

Two workarounds suggest themselves:

1. Make sure your OS can find the library at load time.  On Linux for
example, you'd do this by setting the environment variable LD_LIBRARY_PATH
to include the path /usr/local/pgsql/lib before running your program.

2. Alternatively, create a link to libpq.so somewhere in your existing 
library load path so your system knows where to find it by default.  You
could call it /usr/local/lib/libpq.so, for instance.


Jeroen



pgsql-hackers by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Broken links in postgreSQL.org ads
Next
From: Peter Eisentraut
Date:
Subject: Re: Call for port reports