2

我安装了 OCaml 库。为了证明我有这个:

$ ~/.opam/bin/opam install camlp4
[NOTE] Package camlp4 is already installed (current version is 4.02+system).

和这个:

$ ls `ocamlc -where`/camlp4*
Camlp4.cmi     Camlp4Bin.cmx  Camlp4Parsers   Camlp4Top.cmi      camlp4fulllib.a     camlp4lib.a     camlp4o.cma    camlp4orf.cma   camlp4prof.cmx  camlp4rf.cma
Camlp4Bin.cmi  Camlp4Bin.o    Camlp4Printers  Camlp4Top.cmo      camlp4fulllib.cma   camlp4lib.cma   camlp4of.cma   camlp4prof.cmi  camlp4prof.o
Camlp4Bin.cmo  Camlp4Filters  Camlp4Top       Camlp4_config.cmi  camlp4fulllib.cmxa  camlp4lib.cmxa  camlp4oof.cma  camlp4prof.cmo  camlp4r.cma

但是当我尝试这个时,它无法识别文件

$ ocamlfind query camlp4
ocamlfind: Package `camlp4' not found

我该如何启用它?

我的~/.ocamlinit样子是这样的:

let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;
#use "topfind";;
4

1 回答 1

1

您忘记激活 opam 环境的可能性很大

 eval $(opam config env) 

命令。您正在尝试使用系统编译器进行编译,即系统包管理器安装的编译器

于 2015-07-11T14:20:44.377 回答