Re: erros when making examples in /src/test/examples

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Wei Wang <Wei(dot)Wang(at)cl(dot)cam(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: erros when making examples in /src/test/examples
Date: 2002-05-30 13:42:48
Message-ID: 20020530234248.C12668@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bryan White 2002-05-30 13:52:51 Checksum/Hash Functions
Previous Message Joel Burton 2002-05-30 13:06:28 Re: How to pickup null values in SQL Language?