Thread: libpq

libpq

From
Stephan Bergmann
Date:
Hi!

Compiling the following returns me - executing the result.cgi - the
error:
./result.cgi: can't load library 'libpq.so.2'

gcc -lpq -I/usr/include/mysql -I/usr/local/pgsql/include
-L/usr/local/pgsql/lib -L/usr/lib/mysql program.c
-o result.cgi -Wall -DUNIX -lmysqlclient -lm

All files are at its places. I use PostgreSQL 7.1.3.

What I'm doing wrong?

Thanx
Steve


Re: libpq

From
Peter Eisentraut
Date:
Stephan Bergmann writes:

> Compiling the following returns me - executing the result.cgi - the
> error:
> ./result.cgi: can't load library 'libpq.so.2'
>
> gcc -lpq -I/usr/include/mysql -I/usr/local/pgsql/include
> -L/usr/local/pgsql/lib -L/usr/lib/mysql program.c
> -o result.cgi -Wall -DUNIX -lmysqlclient -lm
>
> All files are at its places. I use PostgreSQL 7.1.3.
>
> What I'm doing wrong?

You didn't mention what platform you're on.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Re: libpq

From
jdassen@cistron.nl (J.H.M. Dassen (Ray))
Date:
Stephan Bergmann <sb@ows.es> wrote:
> Compiling the following returns me - executing the result.cgi - the
> error:
> ./result.cgi: can't load library 'libpq.so.2'

> What I'm doing wrong?

You've not told the dynamic loader to have the directory where you've put
libpq.so.2 in its search path. Set an appropriate LD_LIBRARY_PATH, or (at
least on GNU/Linux) update /etc/ld.so.conf and rerun "ldconfig".

HTH,
Ray
--
"If we put in English phrases, that makes it readable".  That's COBOL.
    Larry Wall on common fallacies of language design