Re: /usr/bin/ld: cannot find -lpq

From: Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: /usr/bin/ld: cannot find -lpq
Date: 2009-12-04 18:58:02
Message-ID: C73E9BBA.91AA%tsakai@gallo.ucsf.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Alvaro,

Thank you for an excellent idea. I'll make note of it.

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

On 12/4/09 5:18 AM, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com> wrote:

Tena Sakai wrote:
> Hi Tom,
>
> Please ignore what I wrote before. I got it. I mean I got it compiled
> successfully on the centOS machine. I was stupid and blind. In order
> to compile, I created an alias for cc with long string for include and
> lib directories. Which was not a bad idea, but I had a typo in my
> alias. Therefore it didn't find the libpq-fe.h file and I screwed that
> up even worse by supplying desired files in the current directory
> from the other machine. I corrected the alias, removed the header
> files in the source directory, and then compilation went smoothly and
> I can now test the program.

FWIW you should always prefer pg_config to help you get the right
compile flags; something like

gcc -I`pg_config --includedir` -L`pg_config --libdir` -lpq ...

That gets you the right include and lib dirs.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2009-12-05 20:47:03 Re: Replication solution
Previous Message Julius Tuskenis 2009-12-04 13:39:48 estimating size of query result