Re: Problems linking to libpq

From: Rasputin <rasputin(at)idoru(dot)mine(dot)nu>
To: Jim Morcombe <robust(at)vianet(dot)net(dot)au>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Problems linking to libpq
Date: 2002-07-17 09:15:34
Message-ID: 20020717091534.GA4374@idoru.mine.nu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

* Jim Morcombe <robust(at)vianet(dot)net(dot)au> [020717 07:02]:
> I included the path to the Include Directory in the first "cc" command which
> produced the Object files,
> so I don't think this is my problem.

Try

cc -I/usr/local/pgsql/include jim.c -L/usr/local/pgsql/lib -lpq -o jim

to confirm. If that still fails, what OS are you running on?
What compiler?

And I'd also check that libpq.so is actually in /usr/local/pgsql/lib...

> Jim
>
> ----- Original Message -----
> 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>
> Sent: Wednesday, July 17, 2002 9:06 AM
> Subject: Re: [NOVICE] Problems linking to libpq
>
>
> > 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.
> >
> > Regards,
> > Andrew.
> > --
> > --------------------------------------------------------------------
> > Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
> > WEB: http://catalyst.net.nz/ 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 http://schoolreunions.co.nz/ yet?
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

--
Rasputin :: Jack of All Trades - Master of Nuns

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Stumbaum, Rainer 2002-07-17 10:55:58 Sort with ORDER BY gives wrong results with german Umlaut charact ers
Previous Message Dusan Juhas 2002-07-17 07:21:31 ERA model generator