Re: [GENERAL] C & C ++Program Problem - Mailing list pgsql-interfaces

From Doug McNaught
Subject Re: [GENERAL] C & C ++Program Problem
Date
Msg-id m3y9ekb6m9.fsf@varsoon.wireboard.com
Whole thread Raw
In response to Re: C & C ++Program Problem  (Arindam Haldar <arindamhaldar@hotpop.com>)
List pgsql-interfaces
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

pgsql-interfaces by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: [GENERAL] C & C ++Program Problem
Next
From: "Nigel J. Andrews"
Date:
Subject: libpgtcl - backend version information patch