Compiling Test Programs - Mailing list pgsql-interfaces

From Scott Holmes
Subject Compiling Test Programs
Date
Msg-id 200105150021.RAA26991@scotts.mynetwork.net
Whole thread Raw
Responses Re: Compiling Test Programs
List 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.





pgsql-interfaces by date:

Previous
From: Giorgio Valoti
Date:
Subject: Re: Including Perl DBI in our CVS
Next
From: Carlos Moreno
Date:
Subject: C++ interface on RH Linux 6.2