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: dynamic link library path under mingw
Hello,

I'm doing something wrong, but can't figure out what?

***********************************
Library compilation, in libeeproms/:

This is a mixed ocaml/c library,
and it depends on a third party DLL
***********************************


$ ocamlc -c eprom_stubs.c
$ ocamlmklib -o m2mEeproms eprom_stubs.o eprom.mli \
   eprom.ml EpromDll.dll

***********************************
Bytecode program compilation, in tests/:
***********************************

$ cd ../tests
$ ocamlc -I c:/cygwin/home/matt/m2m/m2m-ml/libeeproms \
          -I c:/cygwin/home/matt/ocamlmgw/lib/site-lib/oUnit \
          unix.cma oUnit.cma m2mEeproms.cma test_eprom.ml tests.ml
$ ./tests.byte
Fatal error: cannot load shared library dllm2mEeproms
Reason: Le module spécifié est introuvable.


Mmm. Ok! I have to help ocamlrun:

$ ocamlrun -I c:/cygwin/home/matt/m2m/m2m-ml/libeeproms tests.byte
Fatal error: cannot load shared library dllm2mEeproms
Reason: Le module spécifié est introuvable.

Maybe with CAML_LD_LIBRARY_PATH?

$ CAML_LD_LIBRARY_PATH=c:/cygwin/home/matt/m2m/m2m-ml/libeeproms 
./tests.byte
Fatal error: cannot load shared library dllm2mEeproms
Reason: Le module spécifié est introuvable.

In fact, the only way I found is to modify the system dynamic loader 
searched paths (I tried ld.conf, -dllpath…):

$ PATH="/home/matt/m2m/m2m-ml/libeeproms:$PATH" ./tests.byte
Eprom:0:EpromDll.dll revision ... ok

Is this a bug, at least in the documentation ?

$ ocamlc -version
3.11.2