[fpc-pascal] Searching for database libraries

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Sun Dec 9 13:31:00 CET 2012


Michael Van Canneyt wrote:

>>>> The reason that I ask is that it appears that the most efficient way 
>>>> of getting libpq.dll for Windows is to install the ODBC drivers, and 
>>>> they go into a directory typically named like C:\Program 
>>>> Files\psql\ODBC\xxxx\bin where xxxx is a version number.
>>>
>>> Maybe the installer writes something in the registry, in which case 
>>> you could try that first.
>>
>> There's a problem with this on (at least some versions of) Windows: if 
>> you use InitialisePostgres3() it will find libpq.dll but not other 
>> libraries such as ssleay. A workable hack appears to be to cd to the 
>> directory that contains the DLLs before attempting to establish the 
>> database connection.
> 
> I consider this an installation problem, not something that must be 
> catered for in FPC.

I'm inclined to agree with you. However I think it's noteworthy that 
passing a library name to InitialisePostgres3() is an incomplete 
solution since (a) at least on Windows it can't provide a path to 
libpq's prerequisites and (b) if built to be able to use SSL then libpq 
requires that it be available, even if it isn't being used for the 
session being established.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list