Re: erros when making examples in /src/test/examples - Mailing list pgsql-general

From Wei Wang
Subject Re: erros when making examples in /src/test/examples
Date
Msg-id 20020530171416.712c6ff6.ww220@cl.cam.ac.uk
Whole thread Raw
In response to Re: erros when making examples in /src/test/examples  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: erros when making examples in /src/test/examples
List pgsql-general
Great thanks.

But if I am not root, hence no access to /etc/ld.so.conf, where should I specify such libraries for the programs to
lookfor? 

Wei

On Thu, 30 May 2002 23:42:48 +1000
Martijn van Oosterhout <kleptog@svana.org> wrote:

> On Thu, May 30, 2002 at 01:53:19PM +0100, Wei Wang wrote:
> > Thanks a lot.
> >
> >
> > It works:
> >
> > gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/interfaces/libpq -I../../../src/include
-Wl,-rpath,/local/scratch-1/ww220/postgresql-7.1.3/lib -L/homes/ww220/myspace/postgresql-7.1.3/lib testlibpq.c   -o
testlibpq-lpq 
> > testlibpq.c: In function `exit_nicely':
> > testlibpq.c:14: warning: implicit declaration of function `exit'
> >
> > I am a total newbie to almost everything. I put
> > export PATH=/local/scratch-1/ww220/myspace/postgresql-7.1.3/lib:$PATH
> > in .bash_profile and did ". .bash_profile". Is that different from putting
> > -L switch in gcc command?
>
> The PATH variable list directories to look for *programs*. So that's
> different. -L tells the compiler where to look for libraries while linking.
> And if you add that directory to /etc/ld.so.conf (if supported by your
> dynamic linker) then you don't need the -rpath bit either.
>
> --
> Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> > Canada, Mexico, and Australia form the Axis of Nations That
> > Are Actually Quite Nice But Secretly Have Nasty Thoughts About America
>

pgsql-general by date:

Previous
From: Wei Wang
Date:
Subject: postgresql/php/apache installation question.
Next
From: Tom Lane
Date:
Subject: Re: Scaling with memory & disk planning (was Re: Non-linear Performance)