i'm having a problem while trying to compile an ocaml file with ocamlc -o hello hello.ml
it gives me this error
Error: Unbound module Core
which is weird because when i use utop and import the core std with open Core.Std;;
it does work and import it, any ideas of how to solve this problem ?
Thanks in advance
open Core.Std
does not really import core
, it just puts its values in scope so that you can refer to Core.Std.x
as just x
.
To import it you need to pass it to require
the package somehow in your compiler. The easiest way is to use ocamlfind
:
ocamlfind ocamlc -package core -linkpkg -o hello hello.ml
The corresponding way to do that in utop
is by passing -require core
on the command line or #require "core"
in the REPL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With