【问题标题】:ocaml batteries compiling : Unbound module Toploopocaml 电池编译:未绑定模块 Toploop
【发布时间】:2012-11-22 06:11:29
【问题描述】:
**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 ocaml-batteries


【解决方案1】:

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

【讨论】:

  • 电池版本为1.4.1。该系统有两个版本的 OCaml,分别是 3.09 和 4.00。 3.09 的一个位于 /usr/..,另一个位于 /home/xxx/OCaml。我没有权限将它安装在 /usr/... 路径。
  • 文件“libs/estring/pa_estring_top.ml”,第 18 行,字符 15-44:。 pa_estring_top.ml 代码在这里:
  • let _ = let parse = !Toploop.parse_toplevel_phrase 和 lexbufs = ref [] in Toploop.parse_toplevel_phrase := ~
  • 我刚刚意识到我可以自己编辑命令行并让它运行而不是自动运行。非常感谢。错误是正确的。但是还有另一个问题等着我。
猜你喜欢
  • 1970-01-01
  • 2012-09-18
  • 1970-01-01
  • 1970-01-01
  • 2013-08-28
  • 1970-01-01
  • 2013-09-19
  • 2016-01-16
  • 2020-07-24
相关资源
最近更新 更多