ocaml电池编译: Unbound module Toploop

标签 ocaml ocaml-batteries

**Build mode: shared
ocamlbuild -no-links syntax.otarget byte.otarget src/batteries_help.cmo META shared.otarget

Finished, 0 targets (0 cached) in 00:00:00.

+ ocamlfind ocamlc -c -g -annot -warn-error A -package camomile,num,str -package camlp4.lib -pp camlp4of -pp camlp4of -I libs/estring -I benchsuite -I src -I testsuite -I build -I qtest -I libs -I src/syntax/pa_comprehension -I src/syntax/pa_strings -o libs/estring/pa_estring_top.cmo 
libs/estring/pa_estring_top.ml

File "libs/estring/pa_estring_top.ml", line 18, characters 15-44:

Error: Unbound module Toploop

Command exited with code 2.**


Compilation unsuccessful after building 6 targets (5 cached) in 00:00:00.**

我在路径中找到了toploop.cmi:

cd OCaml/lib/ocaml/compiler-libs/
ls topl*

toploop.cmi

如你所见,

export PATH=/home/xxx/OCaml/lib/ocaml/compiler-libs/:$PATH

我已将 /home/xxx/... 作为我的系统路径。但仍然没有成功。我应该怎么做才能包含模块 toploop?

最佳答案

您似乎正在使用 OCaml 4.00 编译 Batteries(哪个版本?),它引入了新的 compiler-libs 目录(但某些发行版之前有一个目录,因此可能会关闭)。 toploop 曾经位于 OCaml stdlib 目录的根目录下,但现在您应该在某处添加 -I +compiler-libs 选项,或者使用相应的 ocamlfind 打包(-package编译器-libs.toplevel)。

关于ocaml电池编译: Unbound module Toploop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13506800/

相关文章:

ocaml - opam安装错误 "no solution found"

performance - OCaml 异常的表现

types - OCaml 中模块包含的类型约束

emacs - 如何下载和安装 OCaml 的 Emacs?

module - Cygwin 和 OCaml : OPAM + Batteries

functional-programming - 如何在 OCaml 中查找数组元素的索引

ocaml - 编译 ocaml-websocket 失败

types - QueΛ的投影算子是什么类型?

ocaml - "OCaml Batteries Included"的稳定性和广泛性如何,是否推荐?