Re: Can't not load libpq.so.3

From: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
To: Fabien DAUMEN <fdaumen(at)technodiva(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Can't not load libpq.so.3
Date: 2003-10-24 16:41:31
Message-ID: 20031024164131.GB12700@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-10-24 16:42:04 Re: Call for port reports
Previous Message Richard Huxton 2003-10-24 16:33:46 Re: Broken links in postgreSQL.org ads