简体   繁体   中英

OCaml: Core package not installing

Following the instructions here for Ubuntu: https://github.com/realworldocaml/book/wiki/Installation-Instructions I've downloaded OCaml and utop which work. However, the Core module cannot be opened. I've downloaded core, async etc as per the instructions.

My edited .ocamlinit file looks like this:

(* Added by OPAM. *)
let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;

#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;

When I open utop I get the message that:

No such package: core.top

No such package: core.syntax

If I try to open core by entering "open Core.Std;;" utop returns: "Error: Unbound module Core". I'm assuming that the installation instruction are out of date but I haven't been able to find any alternate instructions that fix the issue. Is there something wrong with my .ocamlinit file?

I've downloaded core, async etc as per the instructions.

You need to install them, not only download, make sure, that you did:

 opam install core

If it still doesn't work, then make sure, that you activated your opam environment, with

 eval `opam config env`

Notice, the backticks (they are not single quotes). The command should not print anything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM