erros when making examples in /src/test/examples

From: Wei Wang <Wei(dot)Wang(at)cl(dot)cam(dot)ac(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: erros when making examples in /src/test/examples
Date: 2002-05-30 12:11:22
Message-ID: 20020530131122.6cd42c01.ww220@cl.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I am just trying to make the frontend programs in /src/test/examples

make all gives errors:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/interfaces/libpq -I../../../src/include -Wl,-rpath,/local/scratch-1/ww220/postgresql-7.1.3/lib testlibpq.c -o testlibpq
testlibpq.c: In function `exit_nicely':
testlibpq.c:14: warning: implicit declaration of function `exit'
/tmp/ccNom46z.o: In function `exit_nicely':
/tmp/ccNom46z.o(.text+0xa): undefined reference to `PQfinish'
/tmp/ccNom46z.o: In function `main':
/tmp/ccNom46z.o(.text+0x3c): undefined reference to `PQsetdbLogin'
/tmp/ccNom46z.o(.text+0x48): undefined reference to `PQstatus'
/tmp/ccNom46z.o(.text+0x69): undefined reference to `PQerrorMessage'
/tmp/ccNom46z.o(.text+0x99): undefined reference to `PQexec'
/tmp/ccNom46z.o(.text+0xa3): undefined reference to `PQresultStatus'
/tmp/ccNom46z.o(.text+0xc4): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0xd9): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0xe8): undefined reference to `PQexec'
/tmp/ccNom46z.o(.text+0xf2): undefined reference to `PQresultStatus'
/tmp/ccNom46z.o(.text+0x113): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x128): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x137): undefined reference to `PQexec'
/tmp/ccNom46z.o(.text+0x141): undefined reference to `PQresultStatus'
/tmp/ccNom46z.o(.text+0x164): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x17b): undefined reference to `PQnfields'
/tmp/ccNom46z.o(.text+0x192): undefined reference to `PQfname'
/tmp/ccNom46z.o(.text+0x1cf): undefined reference to `PQgetvalue'
/tmp/ccNom46z.o(.text+0x200): undefined reference to `PQntuples'
/tmp/ccNom46z.o(.text+0x210): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x21f): undefined reference to `PQexec'
/tmp/ccNom46z.o(.text+0x229): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x238): undefined reference to `PQexec'
/tmp/ccNom46z.o(.text+0x242): undefined reference to `PQclear'
/tmp/ccNom46z.o(.text+0x24b): undefined reference to `PQfinish'
collect2: ld returned 1 exit status
make: *** [testlibpq] Error 1

Afte searching on the net, I added -lpq but the result is not positive:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/interfaces/libpq -I../../../src/include testlibpq.c -o testlibpq -lpq
testlibpq.c: In function `exit_nicely':
testlibpq.c:14: warning: implicit declaration of function `exit'
/usr/bin/ld: cannot find -lpq
collect2: ld returned 1 exit status

What am I missing here?

Many thanks,

Wei

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-05-30 12:21:04 Re: How to pickup null values in SQL Language?
Previous Message Wei Wang 2002-05-30 12:03:26 Cannot build JDBC driver in 7.1.3.