Compiling Test Programs

From: Scott Holmes <sholmes(at)pacificnet(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org (PG-Interfaces)
Subject: Compiling Test Programs
Date: 2001-05-15 00:21:54
Message-ID: 200105150021.RAA26991@scotts.mynetwork.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

I am by no means a C programmer and I don't know much about Makefiles so I
need a little assistance here. I have Postgresql7.1 compiled from the tar
ball and it's working fine. But now I need to write a program using libpg. I
have psql working fine as well as PHP4 so I've assumed libpg has been included
in my installation. But when I go to compile testlibpq.c I get:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations
-I../../../src/interfaces/libpq -I../../../src/include
-Wl,-rpath,/usr/local/pgsql/lib testlibpq.c -o testlibpq
/tmp/ccy2shMg.o: In function `exit_nicely':
/tmp/ccy2shMg.o(.text+0x7): undefined reference to `PQfinish'
/tmp/ccy2shMg.o: In function `main':
/tmp/ccy2shMg.o(.text+0x30): undefined reference to `PQsetdbLogin'
/tmp/ccy2shMg.o(.text+0x39): undefined reference to `PQstatus'
...
/tmp/ccy2shMg.o(.text+0x205): undefined reference to `PQfinish'
collect2: ld returned 1 exit status
make: *** [testlibpq] Error 1

I do have /usr/local/pgsql/lib/libpq.a

Perhaps someone can point me in the proper direction.

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Carlos Moreno 2001-05-15 03:10:03 C++ interface on RH Linux 6.2
Previous Message Giorgio Valoti 2001-05-14 16:47:23 Re: Including Perl DBI in our CVS