problems in compiling - Mailing list pgsql-general

From Mathew Chandy
Subject problems in compiling
Date
Msg-id 000e01c02e8a$dfd86800$4b0a0a0a@exim.com
Whole thread Raw
Responses Re: problems in compiling  (bmccoy@chapelperilous.net)
List pgsql-general
Hello sir,
 
  Whenever I compile the following sample code
 

# include <stdio.h>
# include <pgsql/libpq-fe.h>
 
void
exit_nicely(PGconn *conn)
{
    PQfinish(conn);
    exit(1);
}
 
main()
{
    char       *pghost,
               *pgport,
               *pgoptions,
               *pgtty;
    char       *dbName;
    int         nFields;
    int         i,
                j;
 
    /* FILE *debug; */
.........
 
}
 
 
i get a compilation error which is of the following
 
/tmp/ccTCPDUs.o(.text+0x77): undefined reference to `PQstatus'
/tmp/ccTCPDUs.o(.text+0xa1): undefined reference to `PQerrorMessage'
/tmp/ccTCPDUs.o(.text+0xd4): undefined reference to `PQexec'
/tmp/ccTCPDUs.o(.text+0xeb): undefined reference to `PQresultStatus'
/tmp/ccTCPDUs.o(.text+0x118): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x130): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x141): undefined reference to `PQexec'
/tmp/ccTCPDUs.o(.text+0x158): undefined reference to `PQresultStatus'
/tmp/ccTCPDUs.o(.text+0x180): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x198): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x1a9): undefined reference to `PQexec'
/tmp/ccTCPDUs.o(.text+0x1c0): undefined reference to `PQresultStatus'
/tmp/ccTCPDUs.o(.text+0x1e8): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x200): undefined reference to `PQnfields'
/tmp/ccTCPDUs.o(.text+0x229): undefined reference to `PQfname'
/tmp/ccTCPDUs.o(.text+0x265): undefined reference to `PQntuples'
/tmp/ccTCPDUs.o(.text+0x29d): undefined reference to `PQgetvalue'
/tmp/ccTCPDUs.o(.text+0x2d7): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x2e8): undefined reference to `PQexec'
/tmp/ccTCPDUs.o(.text+0x2f9): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x30a): undefined reference to `PQexec'
/tmp/ccTCPDUs.o(.text+0x31b): undefined reference to `PQclear'
/tmp/ccTCPDUs.o(.text+0x327): undefined reference to `PQfinish'
 
what is the reason . i use the folowing command line cc file.c
 
thanks in advance
 
Mathew
 

pgsql-general by date:

Previous
From: John McKown
Date:
Subject: Re: distinct
Next
From: "Nikolay Mijaylov"
Date:
Subject: URGENT: pgsql on the web server - memory problems....