Re: [INTERFACES] C & C ++Program Problem

Doug McNaught <doug@wireboard.com>

From: Doug McNaught <doug@wireboard.com>
To: Arindam Haldar <arindamhaldar@hotpop.com>
Cc: Ted Petrosky <tedpet@symcom.com>, pgsql-interfaces@postgresql.org, pgsql-general@postgresql.org, kalelkar@hotmail.com
Date: 2002-05-16T12:49:02Z
Lists: pgsql-general
Arindam Haldar <arindamhaldar@hotpop.com> writes:

> on my RedHat 7.2 i have inserted these lines in the file /etc/ld.so.conf
> /usr/lib/pgsql-7.2

This may or may not be necessary, but if you do it you need to run
'ldconfig' in order for it to take effect.

> using gcc -lpq egtry.c gives error-->
> /usr/bin/ld: cannot find -lpq
> collect2: ld reurned 1 exit status

You need to add a -L flag to the compile so gcc looks in the right
place for libraries.  Also, the '-lpq' should go *after* your source
file name.  So:

gcc -o egtry egtry.c -L/usr/lib/pgsql-7.2 -lpq 

That should get you a lot closer to working.

-Doug