Re: pgsql and lion : not taking good header at compilation. - Mailing list pgsql-novice

From James Hartley
Subject Re: pgsql and lion : not taking good header at compilation.
Date
Msg-id CAKeNXXsHxOML60Zp4=aPXCdfBdjhMw+5oQmaHi_BymU7mT-mHg@mail.gmail.com
Whole thread Raw
In response to pgsql and lion : not taking good header at compilation.  (Pierre-Henry Frohring <pierre.julienr@gmail.com>)
List pgsql-novice
On Mon, Jul 2, 2012 at 3:31 AM, Pierre-Henry Frohring <pierre.julienr@gmail.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.

pgsql-novice by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Volume Shadow Copy
Next
From: Paul Linehan
Date:
Subject: SQL - learning trail?