From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vasquez, Jason <Jason.Vasquez@Connect.Xerox.com>
Cc: pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] PgConnection
Date: Thu, 22 Oct 1998 10:58:05 -0400
Message-ID: <6006.909068285@sss.pgh.pa.us> (raw)
In-Reply-To: <C1CB538EFB88D111A60200805FBB99118B7663@CINMSG1>
"Vasquez, Jason" <Jason.Vasquez@Connect.Xerox.com> 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 <iostream.h>
> #include <libpq++.h>
> 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
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: tgl@sss.pgh.pa.us, Jason.Vasquez@Connect.Xerox.com, pgsql-interfaces@hub.org
Subject: Re: [INTERFACES] PgConnection
In-Reply-To: <6006.909068285@sss.pgh.pa.us>
* 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