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

From: Wei Wang <Wei(dot)Wang(at)cl(dot)cam(dot)ac(dot)uk>
To: Jeremy Buchmann <jeremy(at)wellsgaming(dot)com>
Cc: Wei(dot)Wang(at)cl(dot)cam(dot)ac(dot)uk, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: errors when making examples in /src/test/examples
Date: 2002-05-30 14:41:26
Message-ID: 20020530154126.6119e4ab.ww220@cl.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Thanks.

Yes, it works. I got rid of the -Wl and -rpath and it still works fine.

Can I include this anywhere in .bash_profile so that I don't have to include this library path everytime I compile?

On Thu, 30 May 2002 07:28:42 -0700
Jeremy Buchmann <jeremy(at)wellsgaming(dot)com> wrote:

> Wei Wang wrote:
> > Hi,
> >
> > Afte searching on the net, I added -lpq but the result is not positive:
> >
> > gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/interfaces/libpq -I../../../src/include testlibpq.c -o testlibpq -lpq
> > testlibpq.c: In function `exit_nicely':
> > testlibpq.c:14: warning: implicit declaration of function `exit'
> > /usr/bin/ld: cannot find -lpq
> > collect2: ld returned 1 exit status
> >
> > What am I missing here?
>
> You need to tell gcc where to find libpq.so. You do that with the -L
> option. So find libpq.so (I don't know where it is in the compile tree)
> and then add -L/path/to/libpq to the command.
>
> So you might end up with something like:
>
> gcc -I../../../src/interfaces/libpq -I../../../src/include
> -L../../../src/lib testlibpq.c -o testlibpq -lpq
>
> Again, I don't really know where libpq.so is, so find it and substitute
> the real path for the one above.
>
> --Jeremy
>
>
>
>
>

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message alex 2002-05-30 15:26:33 Re: Direct XML interfaces to optimizer and even executor?
Previous Message Jeremy Buchmann 2002-05-30 14:28:42 Re: errors when making examples in /src/test/examples