Search Postgresql Archives

Re: Which header and lib files to use when compiling libpq-code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 27, 2009 at 10:51:45AM -0400, Kynn Jones wrote:
> I need to compile some code that uses libpq.  For this I need to determine
> the directories to use for the header and library files.
> 
> The machine I'm using has multiple copies of the files libpq-fe.h and
> libpq.a.  How can I determine which one of all these copies are the ones
> that correspond to the Pg server that is currently running on this system?
>  (FWIW, the OS here is Ubuntu Linux.)

In general you don't need to match the server version, the protocol
hasn't changed much in a while so as long as it's less than a few years
old it'll work. New versions have more features though, obviously.

> I tried the naive approach of using the "newest" versions of these files, as
> measured by their modification times.  This produced disastrous results.
>  The code compiled, but resulted in a program that failed in bizarre and
> unpredictable ways, which strongly hinted at one or more silent segmentation
> violations in the C code.  I conjectured that this was the result of a
> mismatched header or library file.  Sure enough, the bizarre failures
> disappeared when I used a different set of header and library files.

Given you're using Ubuntu, why not just install postgresql-dev and use
/usr/include/postgresql.

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux