Re: pgsql and lion : not taking good header at compilation.

From: James Hartley <jjhartley(at)gmail(dot)com>
To: Pierre-Henry Frohring <pierre(dot)julienr(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pgsql and lion : not taking good header at compilation.
Date: 2012-07-02 16:00:22
Message-ID: CAKeNXXsHxOML60Zp4=aPXCdfBdjhMw+5oQmaHi_BymU7mT-mHg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Jul 2, 2012 at 3:31 AM, Pierre-Henry Frohring <
pierre(dot)julienr(at)gmail(dot)com> wrote:

> Here the error message :
> ------------------------------------------------------------------------
> g++ db_test.o -o db_test -L /usr/local/pgsql/bin -lpq
> Undefined symbols for architecture x86_64:
> "_PQpingParams", referenced from:
> _main in db_test.o
> ld: symbol(s) not found for architecture x86_6
>

"Undefined symbols" means that the linker has not been able to resolve all
references encountered in the code when attempting to construct the
executable binary.

You were half-way to the solution when you found out that commenting out
the call to a PostgreSQL-specific function resulted in successful
compilation *and linking*.

The fundamental problem is that the linker was unable to find the library
containing function PQpingParams(). Tom is correct in noticing that the
path provided is most likely incorrect. Once you correct this library
path, the linker should be able to create the desired binary. Until the
linker can find a library which defines this symbol, you will continue to
see "undefined symbol" errors.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Paul Linehan 2012-07-02 16:39:20 SQL - learning trail?
Previous Message Kevin Grittner 2012-07-02 15:53:12 Re: Volume Shadow Copy