PQsetdb

From: "Mohsen Pahlevanzadeh" <mohsen(at)pahlevanzadeh(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: PQsetdb
Date: 2005-02-23 20:32:27
Message-ID: 32993.81.91.153.7.1109190769.squirrel@81.91.153.7
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dears,I have added following constructor to my class:
class CPgsql : public CCore
{
public:
char *pghost,
*pgport,
*pgoptions,
*pgtty;
char *dbName;
PGconn *connection2db;
const char * conninfo;
CPgsql(const char *dbname);
};
CPgsql::CPgsql(const char *dbname)
{
pghost=NULL;
pgport=NULL;
pgoptions=NULL;
pgtty=NULL;
dbName=(char*)dbname;
connection2db=PQsetdb(pghost, pgport, pgoptions, pgtty, dbName);
}//end of constructor
But when i call it ,for example :
CPgsql p("x");
I recieve following error:
[root(at)localhost sql2sql]# make
g++ -c -I/usr/include/mysql -I/usr/include sql2sql.cpp;
g++ -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib -o
sql2sql sql2sql.o ;
sql2sql.o(.text+0x6c): In function `CPgsql::CPgsql[not-in-charge](char
const*)':
: undefined reference to `PQsetdbLogin'
sql2sql.o(.text+0x10e): In function `CPgsql::CPgsql[in-charge](char const*)':
: undefined reference to `PQsetdbLogin'
collect2: ld returned 1 exit status
make: *** [sql2sql] Error 1

Please help me..................................

Responses

  • Re: PQsetdb at 2005-02-23 20:52:52 from Richard Huxton

Browse pgsql-general by date

  From Date Subject
Next Message Jared Carr 2005-02-23 20:36:53 Tracking down cause of duplicated oid in table.
Previous Message Don Doumakes 2005-02-23 20:04:20 Re: Recovering db from cracked server