libpq++ linking

From: "Vazsonyi Peter[ke]" <neko(at)kornel(dot)szif(dot)hu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: libpq++ linking
Date: 1998-01-22 17:51:01
Message-ID: Pine.A32.3.96.980122181418.30680A-100000@kornel.szif.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

I try to use libpq++ (linux: redhat4.2, postgresql-(devel)?-6.2 GNU c)
And i have problem with linking:

[root(at)3dom neko]# g++ -I/usr/include/postgres/ -lpq++ -o a a.cc
/tmp/cca032541.o: In function
ain':
/tmp/cca032541.o(.text+0x22): undefined reference to gConnection::Exec(char
const *)'
...
And more like this. But where is this famous exec?

[root(at)3dom neko]# nm -C /usr/lib/libpq++.a | grep 'Exec(char'
00000348 T PgConnection::Exec(char const *)
U PgConnection::Exec(char const *)

All right. In libpq++.
And I use this lib?
[root(at)3dom neko]# mv /usr/lib/libpq++.a .
[root(at)3dom neko]# g++ -I/usr/include/postgres/ -lpq -lpq++ -o e e.cc
ld: cannot open -lpq++: No such file or directory
Yes. We were use before this.
And include-s is too works.

My first program:
-------- x --------
#include <postgres/libpq++.h>
#ifndef PGDATABASE_H
main(){;};
#else // PGDATABASE_H
#include <iostream.h>
main(){
ExecStatusType XStat;
PgDatabase conn("tval");
XStat=conn.Exec("select oid from szak order by oid ;");
for (int i=0,max=conn.Tuples();max>i;i++) {
cout << conn.GetValue(i,0) << endl;
}
}
#endif // PGDATABASE_H
-------- x --------

I mean, i try all what i can. But somewhere i must done a mistake.
BUT where?!

Please help me...

sprintf ("`-''-/").___..--''"`-._ Error In
("%|s", `6_ 6 ) `-. ( ).`-.__.`) Loading Object
"Petike" (_Y_.)' ._ ) `._ `. ``-..-' line:3
/* Neko */ _..`--'_..-_/ /--'_.' ,' Before /*Neko*/
); (il),-'' (li),' ((!.-'

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-01-22 18:14:51 Re: [HACKERS] Profiling the backend (gprof output) [current devel]
Previous Message Mattias Kregert 1998-01-22 16:36:16 Profiling the backend (gprof output) [current devel]