Scott Holmes writes:
> gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
> -I../../../src/interfaces/libpq -I../../../src/include
> -Wl,-rpath,/usr/local/pgsql/lib testlibpq.c -o testlibpq
> /tmp/ccy2shMg.o: In function `exit_nicely':
> /tmp/ccy2shMg.o(.text+0x7): undefined reference to `PQfinish'
> /tmp/ccy2shMg.o: In function `main':
> /tmp/ccy2shMg.o(.text+0x30): undefined reference to `PQsetdbLogin'
> /tmp/ccy2shMg.o(.text+0x39): undefined reference to `PQstatus'
> ...
> /tmp/ccy2shMg.o(.text+0x205): undefined reference to `PQfinish'
> collect2: ld returned 1 exit status
> make: *** [testlibpq] Error 1
You need to link against libpq. Add '-lpq' to the compilation line.
--
Peter Eisentraut peter_e@gmx.net http://funkturm.homeip.net/~peter