ocaml batteries compiling : Unbound module Toploop

大兔子大兔子 提交于 2019-12-02 06:25:43

问题


**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.**

I have found toploop.cmi in path:

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

toploop.cmi

and as you see,

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

I have made /home/xxx/... as my system path. But it still did not work. What I should do to include the module toploop?


回答1:


You appear to be compiling Batteries (which version?) with OCaml 4.00, which introduced the new compiler-libs directory (but some distributions had one before so that may be off). toploop used to be at the root of the OCaml stdlib's directory, but you should now add a -I +compiler-libs option somewhere, or use the corresponding ocamlfind packaging (-package compiler-libs.toplevel).



来源:https://stackoverflow.com/questions/13506800/ocaml-batteries-compiling-unbound-module-toploop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!