Re: Compiling Test Programs - Mailing list pgsql-interfaces

From Peter Eisentraut
Subject Re: Compiling Test Programs
Date
Msg-id Pine.LNX.4.30.0105151623420.757-100000@peter.localdomain
Whole thread Raw
In response to Compiling Test Programs  (Scott Holmes <sholmes@pacificnet.net>)
List pgsql-interfaces
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



pgsql-interfaces by date:

Previous
From: "Michael Ansley (UK)"
Date:
Subject: RE: How to connect via C++?
Next
From: ROMAN Andres Carlos
Date:
Subject: Searchin libpq.dll & libpq++.dll