Re: Module still unbound even after cmo has benn #load-ed

"'Mr. Herr' [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>

On 11.09.2015 11:04, [email protected] [ocaml_beginners] wrote:
> This morning I copied my "root" OCaml directory containing all
> my OCaml projects, to a different location on the same computer.
> But a lot of weird things happened when I started to work in
> the new directory.
>
> In case someone should ask, yes I checked that my makefile does
> not contain any mention of the path to the directory it's in, and
> yes when in my new directory first thing I did was delete all the cma/o/i's and
> recompile everything from scratch (and I repeated this operation when
> trying to figure out what was wrong).
>
> The weird things happen with my customized toplevel :
>
> Weird phenomenon 1: even though the production/compilation
> of the toplevel goes fine with zero warnings, the created
> toplevel only knows about the modules whose .ml file is
> situated in the root dicrectory. All the modules whose .ml
> file is situated in a subdirectory are declared unbound.
>
> Weird phenomenon 2 : When I see that my toplevel does not
> know about the module implemented in subdir/my_module.ml,
> I naturally try the directive #load"subdir/my_module.cmo".
> The toplevel recognizes the file (I know that because it does
> not issue a "Cannot find file" message), but the module
> My_module is still unbound after the directive has been
> executed.
>
>

This works here:

Do a

#directory "yourdir" ;;

first, then you can load your compiled modules using just the .cmo name without path.

/Str.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.