Skip site navigation (1) Skip section navigation (2)

Re: Problems linking to libpq

From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: Jim Morcombe <robust(at)vianet(dot)net(dot)au>
Cc: pgsql novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Problems linking to libpq
Date: 2002-07-17 01:06:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Tue, 2002-07-16 at 15:59, Jim Morcombe wrote:
> have started at the beginning of the PostSQL Programmer's Guide and have typed in part of example 1.1 on page 23.
> I have followed the instructions in section 1.12 for building the program.
> The program compiles cleanly using the instructions in the manual :
>     cc -I/usr/local/pgsql/include jim.c
> I then compile it with the instruction
>     cc -o jim jim.o -L/usr/local/pgsql/lib -lpq
> However, I get the following errors:
> Undefined symbol
> PQfinish
> PQsetdbLogin
> pqstatus
> fprint
> PQerrorMessage
> The manual says this occurs if I forgot the -lpq option, which I have not done.

You haven't forgotten the libraries, you have forgotten the includes -
you will need a -I/path/to/postgres/include on there as well, I believe.

Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB:        PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201    MOB: +64(21)635-694    OFFICE: +64(4)499-2267
       Are you enrolled at yet?

In response to


pgsql-novice by date

Next:From: Jim MorcombeDate: 2002-07-17 06:04:06
Subject: Re: Problems linking to libpq
Previous:From: Josh BerkusDate: 2002-07-16 21:57:28
Subject: Re: Automatic update of table, does not update web site

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group