postgresql and C++/C

From: "vdm(dot)fbsd(at)virgilio(dot)it" <vdm(dot)fbsd(at)virgilio(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: postgresql and C++/C
Date: 2005-09-28 09:11:45
Message-ID: 15463230.1127898705289.JavaMail.root@pswm16.cp.tin.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Context:FREEBSD 5.4, postgresql 8.0.3

I'm not a C newbye and I'm
having a go at compiling my first, simple C(++) program:

#include
<libpq-fe.h>
int main()
{
PGconn *psql;
psql = PQconnectdb("hostaddr =
'127.0.0.1' port = '' dbname = 'curve' user = 'vi
return 0;
}

But
when
I compile it the following message pops up:

vicbsd# gcc -I
/usr/local/include prova.cpp -o prova
/var/tmp//cceNJFrs.o(.text+0x25):
In function `main':
: undefined reference to `PQconnectdb'
/var/tmp//cceNJFrs.o(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'

What's wrong with it?
Ciao
Vittorio

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Wiersig 2005-09-28 09:37:56 Re: postgresql and C++/C
Previous Message William IT 2005-09-28 08:20:10 Migration From MS SQL 2K