Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.1/8.8.8) with ESMTP id KAA15717 for ; Thu, 22 Oct 1998 10:58:39 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA06008; Thu, 22 Oct 1998 10:58:05 -0400 (EDT) To: "Vasquez, Jason" cc: pgsql-interfaces@hub.org Subject: Re: [INTERFACES] PgConnection In-reply-to: Your message of Wed, 21 Oct 1998 15:37:00 -0400 Date: Thu, 22 Oct 1998 10:58:05 -0400 Message-ID: <6006.909068285@sss.pgh.pa.us> From: Tom Lane "Vasquez, Jason" writes: > I've read the documentation about using the C++ interface to Postgres, but I > seem to be havin trouble getting anything to compile. Following the example > included with the distribution, I have done something similar to this: > #include > #include > void main() { > PgDatabase data ("foo"); > yadayadayada > } > Whenever I do this, I get a compile error stating that there is an undefined > reference to PgConnection. Compile error, or link error? I tried the same, and got complaints about the linker not being able to find several PgConnection routines until I added "-L/usr/local/pgsql/lib -lpq++ -lpq" to the command line: $ g++ -I/usr/local/pgsql/include pgtest.cc collect2: ld returned 1 exit status /bin/ld: Unsatisfied symbols: PgConnection::PgConnection(void)(code) PgConnection::PgConnection(char const *)(code) PgConnection::~PgConnection(void)(code) PQfnumber (code) $ g++ -I/usr/local/pgsql/include pgtest.cc -L/usr/local/pgsql/lib -lpq++ -lpq [ no complaint ] If you're using shared libraries there are also possibilities for installation problems that prevent libpq++ from finding libpq at run time, but evidently you're not getting that far yet :-(. regards, tom lane