Cant compile using stock RH71 and libpq++

From: bend(at)ITstuff(dot)net (John Bend)
To: pgsql-general(at)postgresql(dot)org
Subject: Cant compile using stock RH71 and libpq++
Date: 2001-08-18 18:13:00
Message-ID: 1d5dfd51.0108181012.13e0ab15@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can anyone please help (before I go insane).

In learning C++, QT and PostgreSQL I have created a very simple
program to connect to my database but I cannot compile it. I really
cannot see what I am doing wrong.

Postgress is running and was fully installed when I installed Redhat
7.1. The libpq++ header is truly in the specified path. I can
successfully compile and connect using C.

Thanks in advance.

John Bend.

Here is the simple program:

#include <iostream>
#include <libpq++.h>

int main()
{

PgDatabase db("dbname=template1");

cout << "Program pg1.cpp finished" << endl;

}

I compile it with the line:

g++ pg1.cpp -I/usr/include/pgsql -lpq

And get the following error:

/tmp/ccqlJ23X.o: In function `PgDatabase::PgDatabase(char const *)':
/tmp/ccqlJ23X.o(.PgDatabase::gnu.linkonce.t.(char const *)+0x13):
undefined reference to `PgConnection::PgConnection(char const *)'
/tmp/ccqlJ23X.o: In function `PgDatabase::~PgDatabase(void)':
/tmp/ccqlJ23X.o(.gnu.linkonce.t._._10PgDatabase+0x1d): undefined
reference to `PgConnection::~PgConnection(void)'
/tmp/ccqlJ23X.o: In function `PgDatabase type_info function':
/tmp/ccqlJ23X.o(.gnu.linkonce.t.__tf10PgDatabase+0x10): undefined
reference to `PgConnection type_info function'
/tmp/ccqlJ23X.o(.gnu.linkonce.t.__tf10PgDatabase+0x18): undefined
reference to `PgConnection type_info node'
collect2: ld returned 1 exit status

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Cefull Lo 2001-08-18 19:03:01 time interval question
Previous Message Stephan Szabo 2001-08-18 17:52:25 Re: Glacial delete