Version française
Home     About     Download     Resources     Contact us    
Browse thread
dynamic link library path under mingw
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matthieu Dubuget <matthieu.dubuget@g...>
Subject: Re: [Caml-list] dynamic link library path under mingw

From: Xavier Leroy <Xavier.Leroy@inria.fr>
>>
>> Try setting the OCAMLRUNPARAMS environment variable to the value "v=256".
>> The run-time system will then print additional debug messages
>> concerning DLL searching and loading.
>>
>> - Xavier Leroy


OCAMLRUNPARAM without S!

Thanks for the tip.

> $ OCAMLRUNPARAM="v=256" ./tests.byte
> Opening bytecode executable C:\cygwin\home\matt\m2m\m2m-ml\tests\tests.byte
> Searching C:/cygwin/home/matt/ocamlmgw/lib/stublibs\dllunix.dll
> Loading shared library C:/cygwin/home/matt/ocamlmgw/lib/stublibs\dllunix.dll
> Dynamic symbol at 10009000 (size = 205)
> [0]  100011F8: FlexDLLiniter@12
> [1]  100068C0: WSACleanup@0
> [2]  100068B8: WSAEventSelect@12
> .
> .
> .
> Searching C:/cygwin/home/matt/ocamlmgw/lib/stublibs\dllm2mEeproms.dll
> Searching C:/cygwin/home/matt/ocamlmgw/lib/site-lib/stublibs\dllm2mEeproms.dll
> Searching C:/cygwin/home/matt/ocamlmgw/lib\dllm2mEeproms.dll
> dllm2mEeproms.dll not found in search path
> Loading shared library dllm2mEeproms.dll
> Fatal error: cannot load shared library dllm2mEeproms
> Reason: Le module sp?cifi? est introuvable.

OK. only the paths stored in ld.conf are tried. Testing -I.

> $ OCAMLRUNPARAM="v=256" ocamlrun -I ../libeeproms ./tests.byte
> Opening bytecode executable C:\cygwin\home\matt\ocamlmgw\bin\ocamlrun.exe
> Not a bytecode executable
> Opening bytecode executable C:\cygwin\home\matt\m2m\m2m-ml\tests\tests.byte
> Searching ../libeeproms\dllunix.dll
> Searching C:/cygwin/home/matt/ocamlmgw/lib/stublibs\dllunix.dll
> Loading shared library C:/cygwin/home/matt/ocamlmgw/lib/stublibs\dllunix.dll
> Dynamic symbol at 10009000 (size = 205)
> [0]  100011F8: FlexDLLiniter@12
> [1]  100068C0: WSACleanup@0
> [2]  100068B8: WSAEventSelect@12
> [3]  100068B0: WSAGetLastError@0
> .
> .
> .
> [203]  10005879: worker_push
> [204]  10005438: worker_wait@4
> Searching ../libeeproms\
> Loading shared library ../libeeproms\dllm2mEeproms.dll
> Fatal error: cannot load shared library dllm2mEeproms
> Reason: Le module spécifié est introuvable.


This is better:  was found, but can't be loaded?

Maybe because it depends on another library?

depends.exe allow to check that  needs .

> [   ] DLLM2MEEPROMS.DLL
>      [   ] KERNEL32.DLL
>           [   ] NTDLL.DLL
>      [   ] MSVCRT.DLL
>           [ ^ ] KERNEL32.DLL
>                [F^ ] NTDLL.DLL
>           [ ^ ] NTDLL.DLL
>      [   ] EPROMDLL.DLL
>           [ ^ ] KERNEL32.DLL
>                [F^ ] NTDLL.DLL
>

I have the feeling that dllm2mEeproms.dll is loaded explicitely,
but that the load of EpromDll.dll is left to the operating system?


The following works:

If dllm2mEeproms.dll and EpromDll.dll are both in ../libeeproms:
> PATH="../libeeproms:$PATH" OCAMLRUNPARAM="v=256" ocamlrun -I ../libeeproms ./tests.byte


If I move EpromDll.dll in ../libeeproms/toto:
> PATH="../libeeproms/toto:$PATH" ocamlrun -I "../libeeproms" tests.byte


Two separated problems, then:
- how to store a search path into tests.byte?
- is it possible to have EpromDll.dll loaded, even if not in a $PATH 
directory?

Salutations