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

From Martijn van Oosterhout
Subject Re: erros when making examples in /src/test/examples
Date
Msg-id 20020530234248.C12668@svana.org
Whole thread Raw
In response to Re: erros when making examples in /src/test/examples  (Wei Wang <Wei.Wang@cl.cam.ac.uk>)
Responses Re: erros when making examples in /src/test/examples
List pgsql-general
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: "Joel Burton"
Date:
Subject: Re: How to pickup null values in SQL Language?
Next
From: "Bryan White"
Date:
Subject: Checksum/Hash Functions