Looks like you're missing the "-lpq" linker reference.
Also, don't forget to include the "/usr/include/pgsql/libpq-fe.h" file
in your source. (You know the drill ... #include <pgsql/libpq-fe.h> )
Check out the Programmer docs closely, they helped me a lot.
Best regards,
amp wrote:
> Hello,
>
> I have a new linux system running RedHat 7.2. The Postgreqsl installation I have is the one that came with RH. I
downloadedall the pdfs for Administration, Programmer, Tutorial, etc. I am trying to write a simple C program to use
thedatabase I just created. My command line looks like this:
>
> gcc -Wall -o test1 test1.c
>
> >From this, I get a long list of 'Undefined Reference' errors for any function that starts with 'PQ'.
>
> I assume I am missing a library or something. I am new to Linux programming (although I am an experienced C/C++
programmerunder windows).
>
> What am I missing? Thanks in advance.
>
> Andrew Pierce
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>
--
John Burski
I.T. Manager and Systems Administration
911 Emergency Products, Inc.
25 Sixth Avenue North
Saint Cloud, MN 56303
John.Burski@911ep.com
800-863-6911, extension 221
FAX: 800-863-2991
www.911ep.com