Re: Compiling Test Programs

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Scott Holmes <sholmes(at)pacificnet(dot)net>
Cc: PG-Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Compiling Test Programs
Date: 2001-05-15 14:24:26
Message-ID: Pine.LNX.4.30.0105151623420.757-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Chris Hayner 2001-05-15 20:32:10 help with programming
Previous Message Michael Ansley (UK) 2001-05-15 11:53:10 RE: How to connect via C++?