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 ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend