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.
> I have a new linux system running RedHat 7.2. The Postgreqsl installation I have is the one that came with RH. I downloaded all the pdfs for Administration, Programmer, Tutorial, etc. I am trying to write a simple C program to use the database 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++ programmer under 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
I.T. Manager and Systems Administration
911 Emergency Products, Inc.
25 Sixth Avenue North
Saint Cloud, MN 56303
800-863-6911, extension 221
In response to
- at 2001-11-12 16:04:54 from amp
pgsql-novice by date
|Next:||From: Joe Moraca||Date: 2001-11-12 18:32:23|
|Subject: XML & Postgresql|
|Previous:||From: Francisco Reyes||Date: 2001-11-12 16:19:34|
|Subject: Re: config problems|