In my project I have a file that uses Core.Std stuff, so I have run
opam install core
and added
open Core.Std
in my file.
When I run
ocamlbuild myprogram.native
it says:
Error: Unbound module Core
pointing to line with the open statement above.
So, I try this:
ocamlbuild -use-ocamlfind -pkgs core.std myprogram.native
and get the following message:
ocamlfind: Package `core.std' not found
So I thought that maybe I needed to run opam install core.std as well, but apparently there is no such thing according to opam. I also tried "open Core.Std;;" in the ocaml repl, but that did not work either. Any ideas?
You can either use corebuild
which is usually shipped with this library or, you can try this:
ocamlbuild -use-ocamlfind -pkg core
P.S. use ocamlfind list
command to view the list of available packages.
P.P.S. In addition to corebuild
they usually ship coretop
, a script that allows you to run core-enabled top-level. It uses utop
underneath the hood, so make sure that you have installed it with opam install utop
(if you're using opam
), before your experiments.
Remove .std from your ocamlbuild cmd?
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