Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 518

Module unavailable when compiling another file that uses it in OCaml

$
0
0

I have multiple compilation units in OCaml, one of which is causing a few problems. One compilation unit has two files foo_one.mli and foo_one.ml, these compile without any errors when using ocamlc. The other compilation unit has two files shoo.mli and shoo.ml. shoo.ml needs to make use of functions from foo_one, and so in the file shoo.ml I use open Foo_one. To compile, I use the command ocamlc foo_one.mli shoo.mli shoo.ml and the compiler returns the error: Module Foo_one is unavailable (required by Shoo).

What is causing this error and how can it be solved?

I made sure that the compilation units are all in the same directory, with the files in one compilation unit having the same name and capitalising the name of the module I am including in shoo.ml.


Viewing all articles
Browse latest Browse all 518

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>