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@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..................................