Re: Difficulty getting started with Postgres C++ interface - Mailing list pgsql-interfaces

From Jeroen T. Vermeulen
Subject Re: Difficulty getting started with Postgres C++ interface
Date
Msg-id 20030129131339.GF46476@xs4all.nl
Whole thread Raw
In response to Difficulty getting started with Postgres C++ interface  ("David Wright" <dwright@mergetel.com>)
List pgsql-interfaces
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(charconst *)'
 

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



pgsql-interfaces by date:

Previous
From: "David Wright"
Date:
Subject: Difficulty getting started with Postgres C++ interface
Next
From: ljb
Date:
Subject: Any interest in a Tcl-only libpgtcl project?