Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6046D475CC4 for ; Wed, 29 Jan 2003 08:14:41 -0500 (EST) Received: from mxzilla2.xs4all.nl (mxzilla2.xs4all.nl [194.109.6.50]) by postgresql.org (Postfix) with ESMTP id 830B5475AD7 for ; Wed, 29 Jan 2003 08:14:40 -0500 (EST) Received: from xs1.xs4all.nl (xs1.xs4all.nl [194.109.3.11]) by mxzilla2.xs4all.nl (8.12.3/8.12.3) with ESMTP id h0TDDdKt025813; Wed, 29 Jan 2003 14:13:40 +0100 (CET) Received: (from jtv@localhost) by xs1.xs4all.nl (8.11.6/8.11.6) id h0TDDd256299; Wed, 29 Jan 2003 14:13:39 +0100 (CET) (envelope-from jtv) Date: Wed, 29 Jan 2003 14:13:39 +0100 From: "Jeroen T. Vermeulen" To: David Wright Cc: pgsql-interfaces@postgresql.org Subject: Re: Difficulty getting started with Postgres C++ interface Message-ID: <20030129131339.GF46476@xs4all.nl> Mail-Followup-To: David Wright , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/117 X-Sequence-Number: 3617 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