Обсуждение: ...

Поиск
Список
Период
Сортировка

...

От
Zudi Iswanto
Дата:
Dear all ...
I have a postgres problem 
I am developing application with c++
to connect to postgres SQL.

When I compiled my source.cc I found some error like this :

/tmp/ccy63XDd.o: In function `main':
/tmp/ccy63XDd.o(.text+0x70): undefined reference to `PQsetdbLogin'
/tmp/ccy63XDd.o(.text+0x91): undefined reference to `PQstatus'
/tmp/ccy63XDd.o(.text+0xc4): undefined reference to `PQerrorMessage'
collect2: ld returned 1 exit status

Please help me to fix the problem .....
Thank you for your attention ....

-- 
Zudi Iswanto


Re:

От
Patrick Welche
Дата:
On Thu, Jul 26, 2001 at 04:55:14PM +0700, Zudi Iswanto wrote:
> I am developing application with c++
... 
> /tmp/ccy63XDd.o(.text+0x70): undefined reference to `PQsetdbLogin'
> /tmp/ccy63XDd.o(.text+0x91): undefined reference to `PQstatus'
> /tmp/ccy63XDd.o(.text+0xc4): undefined reference to `PQerrorMessage'

Did you link libpq as well as libpq++ ? ie something like
-L/usr/local/lib/pgsql -Wl,-R/usr/local/lib/pgsql -lpq++ -lpq

Cheers,

Patrick