It looks like it's having problems finding where your shared objects,
archives, etc. are located. They should be under <postgresql path>/lib
or wherever you installed them.
Try:
c++ -g -O2 -o everestserver main.o -L <postgresql path>/lib -lpq
I don't know what your makefile looks like, but you may want to be sure
that it includes any of your header file directories as well with
something like:
c++ -I <postgre include directory> -g -O2 -o everestserver main.o -L
<postgresql path>/lib -lpq
Also, be sure to set your LD_LIBRARY_PATH environment variable to your
postgre library path.
(csh, tcsh shells)
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/<postgresql path>/lib
OR
(sh, ksh, bash shells)
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/<postgresql path>/lib
export LD_LIBRARY_PATH
Thanks.
Rynell Wesson
On Mon, 27 Nov 2000, Eduardo Kotujansky wrote:
> Iam with a problem to compile a C program that uses
> postgres. I am on FreeBSD with Potgsresql installed
> in usr/local/pgsql.
>
> any help?
>
> compile messages:
>
>
> make all-recursive
> Making all in everestserver
> Making all in docs
> Making all in en
> c++ -g -O2 -o everestserver main.o -lpq
> /usr/libexec/elf/ld: cannot find -lpq
> *** Error code 1
>
> Stop in /root/rewq/everestserver.
> *** Error code 1
>
> Stop in /root/rewq/everestserver.
> *** Error code 1
>
> Stop in /root/rewq.
> *** Error code 1
>
> Stop in /root/rewq.
>
>