Lisp HUG Maillist Archive

fli:register-module & dll dependencies

Hello,

 

I’m trying to register a foreign language interface for the libpq.dll of PostgreSQL 9.5 – 32bits.

This dll seems to depend on 4 other dlls: libeay32.dll, libiconv-2.dll, libintl-8.dll, ssleay32.dll.

All dlls can be found together in the same folder <PostgreSQL Folder>/9.1/bin.

 

I managed to make it work by copying all 5 dlls to a seperate folder then adding this folder’s path to the PATH environement variable of my system. The command is then simply :

(fli:register-module "pgsql" :real-name "libpq.dll" :connection-style :immediate)

 

However, if i remove the folder’s path from my PATH environement variable and use the command :

(fli:register-module "pgsql" :real-name "<folder absolute path>/libpq.dll" :connection-style :immediate)

I receive an Error: Could not register handle for external module "pgsql".

 

Having to change the PATH environement variable of the systems my application will be deployed on… well they won’t let me do it. Is there a way to make it work without it ?

 

Note : for experiment sake, you can move libpq.dll to a separate folder and try registering it with it’s path… this will produce the same error. However, adding back the path of the folder containing the 4 other dlls to the PATH environement variable will make the registration work again.

 

I suspect the problem is either in how Windows handle dll dependencies or how fli:register-module does it… or even in how the dependencies are defined in libpq.dll …

 

Thank you for your help.

 

Jérémie Daelen

 

Configuration :

LispWorks 6.1.1 Enterprise Edition - 32 bits

Windows 10 - 64 bits

Re: fli:register-module & dll dependencies

Jérémie Daelen <jeremie.daelen@labage.be> writes:

> Hello,
>
> I’m trying to register a foreign language interface for the libpq.dll of PostgreSQL 9.5 – 32bits.
>
> This dll seems to depend on 4 other dlls: libeay32.dll, libiconv-2.dll, libintl-8.dll, ssleay32.dll.
>
> All dlls can be found together in the same folder <PostgreSQL Folder>/9..1/bin.
>
> I managed to make it work by copying all 5 dlls to a seperate folder then adding this folder’s path
> to the PATH environement variable of my system. The command is then simply :
>
> (fli:register-module "pgsql" :real-name "libpq.dll" :connection-style :immediate)
>
> However, if i remove the folder’s path from my PATH environement variable and use the command :
>
> (fli:register-module "pgsql" :real-name "<folder absolute path>/
> libpq.dll" :connection-style :immediate)

Hi,

Have you tried the following?

  (fli:register-module "<folder absolute path>/libpq.dll")
  
That's how I did it with LWW 4.3.7.  Maybe they changed it in newer LWW?

If those DLL's are part of the package you deliver, you may also
want to use LW:LISP-IMAGE-NAME, MAKE-PATHNAME, and MERGE-PATHNAMES
to get the absolute paths of those DLL's, no matter where your users
may install your package.  

Best wishes,

-cph

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: fli:register-module & dll dependencies

cph <cph@chi-square-works.com> writes:

> Jérémie Daelen <jeremie.daelen@labage.be> writes:
>
>> Hello,
>>
>> I’m trying to register a foreign language interface for the libpq.dll of PostgreSQL 9.5 – 32bits.
>>
>> This dll seems to depend on 4 other dlls: libeay32.dll, libiconv-2.dll, libintl-8.dll, ssleay32.dll.
>>
>> All dlls can be found together in the same folder <PostgreSQL Folder>/9.1/bin.
>>
>> I managed to make it work by copying all 5 dlls to a seperate folder then adding this folder’s path
>> to the PATH environement variable of my system. The command is then simply :
>>
>> (fli:register-module "pgsql" :real-name "libpq.dll" :connection-style :immediate)
>>
>> However, if i remove the folder’s path from my PATH environement variable and use the command :
>>
>> (fli:register-module "pgsql" :real-name "<folder absolute path>/
>> libpq.dll" :connection-style :immediate)
>
> Hi,
>
> Have you tried the following?
>
>   (fli:register-module "<folder absolute path>/libpq.dll")
                                                ^
I just did a quick check in my old code, those computed absolute
paths for my DLL's were of the form: "C:\\ABSOLUTE\\PATH\\SOME.DLL".
Maybe slash or backslash does matter.

Best wishes,

-cph

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: fli:register-module & dll dependencies

>>>
>>> (fli:register-module "pgsql" :real-name "<folder absolute path>/
>>> libpq.dll" :connection-style :immediate)
>>
>> Hi,
>>
>> Have you tried the following?
>>
>>   (fli:register-module "<folder absolute path>/libpq.dll")
>                                                 ^
> I just did a quick check in my old code, those computed absolute
> paths for my DLL's were of the form: "C:\\ABSOLUTE\\PATH\\SOME.DLL".
> Maybe slash or backslash does matter.
                               ^
                              NOT
Best,

-cph

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


RE: fli:register-module & dll dependencies

>>> (fli:register-module "pgsql" :real-name "<folder absolute path>/

>>> libpq.dll" :connection-style :immediate)

>> 

>> Hi,

>> 

>> Have you tried the following?

>> 

>>   (fli:register-module "<folder absolute path>/libpq.dll")

>                                                 ^

> I just did a quick check in my old code, those computed absolute

> paths for my DLL's were of the form: "C:\\ABSOLUTE\\PATH\\SOME.DLL".

> Maybe slash or backslash does matter.

                               ^

                              NOT

 

Thank you for helping me.

 

I tried both relative and absolut path to no avail. I also tried building the absolute path using make-path name but it did not change anything. And indeed using double slaches our backslashes does not matter.

 

I truly beleive this is linked to the fact that libpq.dll dépends on the other 4 dlls… registering and connecting any other dll causes no problem. Here is a link to download all 5 dlls (if you do not trust this link, you can find them in the bin folder of any PostgreSQL – 32 bits install).

 

https://www.dropbox.com/sh/3b5tqipvc916zxz/AACaDsLqZj-eVc2_cnkLx2Aca?dl=0

 

I really see only 3 possibilities :

- DLL dependency is handled by LispWorks’ fli:register-module and do not use the :real-name parameter for them.

- DLL dependency is handled by the operating system and Windows 10 only look its system folder and PATH folders.

- DLL dependency is written in a Strange fashion Inside libpq.dll such that LispWorks or Windows cannot handle them.

 

Best,

 

Jérémie Daelen

Updated at: 2020-12-10 08:32 UTC