Problems with c, compiling, libraries - Mailing list pgsql-novice

From Kirby Krueger
Subject Problems with c, compiling, libraries
Date
Msg-id LHEPILOHLNIGBPAOJMNJIEDPCBAA.kirbyk@idiom.com
Whole thread Raw
Responses Re: Problems with c, compiling, libraries
List pgsql-novice
Greetings.

I'm trying to compile a C program that connects to a postgreSQL database.
I'm successfully getting past the compile step, with:
#include "/usr/include/pgsql/libpq-fe.h"

However, in the link step, I get lots of things like:
/home/kirbyk/ugxProcessTurn.c:1954: undefined reference to `PQexec'
/home/kirbyk/ugxProcessTurn.c:1955: undefined reference to `PQresultStatus'
/home/kirbyk/ugxProcessTurn.c:1958: undefined reference to `PQclear'
/home/kirbyk/ugxProcessTurn.c:1960: undefined reference to `PQgetvalue'
/home/kirbyk/ugxProcessTurn.c:1961: undefined reference to `PQgetvalue'
/home/kirbyk/ugxProcessTurn.c:1975: undefined reference to `PQexec'

... and so on.

I suspect that some libraries didn't get installed in the right place.  I'm
not responsible for that sort of thing, but the guy who is claimed that he
installed all the development packages for postgreSQL.

I don't see anything that would be useful in /usr/lib.  There is a
/usr/lib/pgsql, which contains:
plpgsql.so*  pltcl.so*

I tried including these in the link step, but they clearly are for some
purpose other than the functions in libpq-fe.h.

Can someone give me some pointers?  My productivity has ground to a
screeching halt trying to figure this out.  The names of the libraries I
ought to have installed would be very helpful; what rpms to get them from
would be even moreso.  We're running a recent version of RedHat Linux.

Thanks for any assistance!

-- Kirby


pgsql-novice by date:

Previous
From: "Chad Thompson"
Date:
Subject: Re: Inner join syntax
Next
From: Josh Berkus
Date:
Subject: Missing Review