On Thu, 23 Nov 2006, drehman27 wrote:
> I would like to use the DynArray module from ExtLib.
>
> Here's what I did:
>
> I installed godi and using godi_console installed ExtLib.
>
> I installed godi at: /home/user/godi
>
> When I use "ocamlfind list" I saw that extlib was available so I added
> the following line to my MakeFile.
> PACKS = unix bigarray extlib
>
> I compiled my program with "make bc top"
> But when I try the following in the toplevel I created, the DynArray
> module is not loaded. How can I fix this?
>
> # DynArray.create;;
> Unbound value DynArray.create
I believe it's a search path problem. I'm not sure whether it qualifies as
a bug or not. But it's definitely counter-intuitive since the library is
actually loaded. I suspect the toplevel is looking for dynArray.cmi and
doesn't find it because the search path doesn't include it, although the
library is loaded (since you may have some junk in this directory, you
may not want to put it automatically into the search path which would
explain the observed behavior - maybe you should ask the author of
findlib, Gerd Stolpmann, directly or though caml-list%40inria.fr">caml-list
inria.fr).
Anyway, what you should do is:
#use "topfind";;
#require "extlib";;
This really adds extlib's directory to the search path:
# #require "extlib";;
/home/martin/godi/lib/ocaml/pkg-lib/extlib: added to search path
/home/martin/godi/lib/ocaml/pkg-lib/extlib/extLib.cma: loaded
--
Martin Jambon, PhD
http://martin.jambon.free.fr
.