From: Jeroen T. Vermeulen <jtv@xs4all.nl>
To: David Wright <dwright@mergetel.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Difficulty getting started with Postgres C++ interface
Date: Wed, 29 Jan 2003 14:13:39 +0100
Message-ID: <20030129131339.GF46476@xs4all.nl> (raw)
In-Reply-To: <pan.2003.01.27.17.41.54.499.3486@mergetel.com>
References: <pan.2003.01.27.17.41.54.499.3486@mergetel.com>
On Mon, Jan 27, 2003 at 05:42:11PM -0500, David Wright wrote:
>
> g++ -I/usr/include/pgsql myc.cpp -o myc
>
> /home/dwright/tmp/ccx7SvXE.o(.PgDatabase::gnu.linkonce.t.(char const *)+0x13): undefined reference to `PgConnection::PgConnection(char const *)'
If you're going to use a library, you'll have to link to it to get
a working program:
g++ -I/usr/include/pgsql myc.cpp -lpq++ -o myc
You may also have to link to the underlying C library, libpq:
g++ -I/usr/include/pgsql myc.cpp -lpq++ -lpq -o myc
And finally--shameless plug coming up--you may want to use libpqxx
instead of libpq++:
http://gborg.postgresql.org/project/libpqxx/
Jeroen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jtv@xs4all.nl, dwright@mergetel.com
Subject: Re: Difficulty getting started with Postgres C++ interface
In-Reply-To: <20030129131339.GF46476@xs4all.nl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox