Teruel Tony wrote:
> 
> Hi,
> 
> I'm interacting with postgeSQL using C languaje,
> I'm having compilation problems.
> I set the compilation definition as:
> PGSQL_INCLUDE=/usr/local/pgsql/include/libpq
> 
> (that's where I got the path to libpq)
> and I'm using something like this (I'm using
> sockets) to compile:
> 
> cc -s -I/usr/local/pgsql/include -L/usr/local/pgsql/lib program.c -lm -lnsl
> -o program.exe
 
> By the way I'm using Linux. I got the following error:
 
> /tmp/ccgtGrLd.o: In function `test':
> /tmp/ccgtGrLd.o(.text+0xa): undefined reference to `PQerrorMessage'
> /tmp/ccgtGrLd.o(.text+0x2e): undefined reference to `PQfinish'

You need to run ldconfig to tell it where to find libpq.so, or link in
libpq.a statically, which means you will have to also link in
/usr/lib/libcrypt.a for most linuxen.  

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Reply via email to