Re: [HACKERS] libpq++ linking

Maarten Boekhold <maartenb@dutepp0.et.tudelft.nl>

From: Maarten Boekhold <maartenb@dutepp0.et.tudelft.nl>
To: "Vazsonyi Peter[ke]" <neko@kornel.szif.hu>
Cc: pgsql-hackers@postgreSQL.org
Date: 1998-01-22T20:22:20Z
Lists: pgsql-hackers
On Thu, 22 Jan 1998, Vazsonyi Peter[ke] wrote:

> Hello!
> 
> I try to use libpq++ (linux: redhat4.2, postgresql-(devel)?-6.2 GNU c)
> And i have problem with linking:
> 
> [root@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@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@3dom neko]# mv /usr/lib/libpq++.a .    
> [root@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.

Try putting the -lpq++ *after* your input files, ie. last on the line.

Maarten

_____________________________________________________________________________
|     Maarten Boekhold, Faculty of Electrical Engineering TU Delft,   NL    |
|           Computer Architecture and Digital Technique section             |
|                          M.Boekhold@et.tudelft.nl                         |
-----------------------------------------------------------------------------