rhayhow <rhayhow@cs.nmsu.edu> writes:
> I get the following errors...
> /usr/local/postgresql/lib/libpq.a(fe-connect.o): In function `connectDB':
> fe-connect.o(.text+0xf6c): undefined reference to `gethostbyname'
> fe-connect.o(.text+0x10e0): undefined reference to `socket'
> fe-connect.o(.text+0x116c): undefined reference to `connect'
> fe-connect.o(.text+0x1218): undefined reference to `getprotobyname'
> fe-connect.o(.text+0x127c): undefined reference to `setsockopt'
> fe-connect.o(.text+0x12e0): undefined reference to `getsockname'
On some systems, these network-related functions are not in the regular
C library, but in other libraries. Likely you need to add "-lsocket"
or something like that to the link command.
The Postgres configure script presumably got it right, if you were able
to install a working psql. Try looking at what the makefile for psql
is doing.
regards, tom lane