error in code - Mailing list pgsql-admin

From Ashok Chauhan
Subject error in code
Date
Msg-id 1070891730.1268.18.camel@chi
Whole thread Raw
Responses Re: error in code
List pgsql-admin
hi
*********************************
# include <stdio.h>
# include <stdlib.h>
# include </usr/include/libpq-fe.h>
# include </usr/include/libpq/libpq-fs.h>

int main()
{
        PGresult *result;
        PGconn *conn;
        int feild;
        conn = PQconnectdb ("ashok");
        result = PQexec (conn, "select * from bill");
        feild = PQntuples (result);
        printf("%d",feild);
        PQclear (result);
        PQfinish (conn);
        printf("hello");
        return 1;


}

I make the following code with the make command but give the following
the errors:-

/tmp/ccUWs9W9.o: In function `main':
/tmp/ccUWs9W9.o(.text+0x19): undefined reference to `PQconnectdb'
/tmp/ccUWs9W9.o(.text+0x2f): undefined reference to `PQexec'
/tmp/ccUWs9W9.o(.text+0x40): undefined reference to `PQntuples'
/tmp/ccUWs9W9.o(.text+0x64): undefined reference to `PQclear'
/tmp/ccUWs9W9.o(.text+0x72): undefined reference to `PQfinish'
collect2: ld returned 1 exit status
make: *** [aa] Error 1

plz help me.

pgsql-admin by date:

Previous
From: "Andrei Bintintan"
Date:
Subject: Re: timestamp field
Next
From: Oliver Elphick
Date:
Subject: Re: error in code