[fpc-pascal] Searching for database libraries

Michael Van Canneyt michael at freepascal.org
Sun Dec 9 12:45:13 CET 2012



On Sat, 8 Dec 2012, Mark Morgan Lloyd wrote:

> Michael Van Canneyt wrote:
>> On Fri, 7 Dec 2012, Mark Morgan Lloyd wrote:
>> 
>>> When using something like InitialisePostgres3(), if the approximate 
>>> location of the database library (.so or .dll) is known, what's the most 
>>> effective way of finding the exact file? Is there a single routine that 
>>> does a recursive search?
>> 
>> No.
>> 
>>> 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.

Michael.



More information about the fpc-pascal mailing list