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