Thread: help with libpq++

help with libpq++

From
"Ted Petrosky"
Date:
I am getting an error with libpq++.a

/usr/bin/ld: table of contents for archive: /usr/local/pgsql/lib/libpq++.a is out of 
date; rerun ranlib(1) (can't load from it)

so I did:

ranlib libpq++.a

I had the same problem with libpq.a and the above fixed the problem.

now I get:

(t2.cpp refers to the example from the momjian book that i keyed in)
[localhost:~] postgres% c++ -I/usr/local/pgsql/include -o myapp t2.cpp -L/usr/
local/pgsql/lib -lpq++
/usr/bin/ld: Undefined symbols:
_PQclear
_PQconnectdb
_PQdb
_PQerrorMessage
_PQexec
_PQfinish
_PQnotifies
_PQresultStatus
_PQstatus
_PQcmdTuples
_PQendcopy
_PQfname
_PQfnumber
_PQfsize
_PQftype
_PQgetisnull
_PQgetlength
_PQgetline
_PQgetvalue
_PQnfields
_PQntuples
_PQoidStatus
_PQprint
_PQputline

I am on a Mac OSX 10.1.4
libpq++.a is in /usr/local/pgsql/lib

[localhost:~] postgres% c++ --version
2.95.2
[localhost:~] postgres%

Thanks,
Ted




Re: help with libpq++

From
Peter Eisentraut
Date:
Ted Petrosky writes:

> [localhost:~] postgres% c++ -I/usr/local/pgsql/include -o myapp t2.cpp -L/usr/
> local/pgsql/lib -lpq++
> /usr/bin/ld: Undefined symbols:
> _PQclear
[...]

Add -lpq.

-- 
Peter Eisentraut   peter_e@gmx.net