Re: ERROR

From: Bruno LEVEQUE <bruno(dot)leveque(at)net6d(dot)com>
To: Ashok Chauhan <ashok(at)kalculate(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ERROR
Date: 2003-11-22 14:03:05
Message-ID: 3FBF6C99.6030701@net6d.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

Change your connect line with :

conn = PQconnectdb("dbname='database'");

Bruno

Ashok Chauhan wrote:

># include <stdlib.h>
># include <libpq-fe.h>
>int main()
>{
> int feild;
> PGresult *result;
> PGconn *conn;
> conn = PQconnectdb("database");
> result = PQexec (conn, "select * from teblename");
> feild = PQntuples (result);
> printf("%d",feild);
> PQclear(result);
> PQfinish (conn);
> return (1);
>
>}
>
>I RUN THE ABOVE PROGRAM BUT IT GIVE SOME ERRORS THAT ARE FOLLOWS:-
>
>/tmp/ccApFcdl.o: In function `main':
>/tmp/ccApFcdl.o(.text+0x19): undefined reference to `PQconnectdb'
>/tmp/ccApFcdl.o(.text+0x2f): undefined reference to `PQexec'
>/tmp/ccApFcdl.o(.text+0x40): undefined reference to `PQntuples'
>/tmp/ccApFcdl.o(.text+0x64): undefined reference to `PQclear'
>/tmp/ccApFcdl.o(.text+0x72): undefined reference to `PQfinish'
>collect2: ld returned 1 exit status
>
>HELP ME
>
>---------------------------(end of broadcast)---------------------------
>TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>
>

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno(dot)leveque(at)net6d(dot)com
http://www.net6d.com

In response to

  • ERROR at 2003-11-22 13:47:51 from Ashok Chauhan

Browse pgsql-admin by date

  From Date Subject
Next Message Nigel J. Andrews 2003-11-22 15:42:52 Re: uploading files
Previous Message Ashok Chauhan 2003-11-22 13:47:51 ERROR