Re: undefined reference to xxx

From: Patrick Welche <prlw1(at)newn(dot)cam(dot)ac(dot)uk>
To: Ismail Tiryaki <ismail(at)ibu(dot)edu(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: undefined reference to xxx
Date: 2001-02-01 11:22:31
Message-ID: 20010201112231.C22280@quartz.newn.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 31, 2001 at 09:43:50AM +0200, Ismail Tiryaki wrote:
>
> Hi all,
> I have joined this list newly, and I have some question this
> question may be solved up to now
>
> I wrote simple c source this is connect my postgresql database
> but when I compile my source I see some errors this is listed below
> gcc -g connect.c -o connec /usr/lib/libpg.a -I /usr/include/pgsql
> /tmp/cc91os3S.o: In function `exit_nicely': /root/connect.c:7: undefined
> reference to `PQfinish' /tmp/cc91os3S.o: In function `main':
> /root/connect.c:17: undefined reference to `PQsetdbLogin'
> /root/connect.c:18: undefined reference to `PQstatus' /root/connect.c:20:
> undefined reference to `PQerrorMessage' collect2: ld returned 1 exit
> status
> How can I solve this problem?Please help me?
> I look forward your message as soon as possible?
> Please!

I would guess a typo: PQerrorMessage, on my system, is in libpq.a, not libpg.a
(which I don't have)

Cheers,

Patrick

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martin A. Marques 2001-02-01 11:26:49 Re: Re: grant privileges to a database [URGENT]
Previous Message Jose Manuel Lorenzo Lopez 2001-02-01 10:26:28 Problem creating pgsql_perl5 module