2
**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?

Canoe
  • 347
  • 1
  • 3
  • 11
  • thanks a lot for your edit. I am a new flower. I will pay my attention to the format in my future questions. :) – Canoe Nov 22 '12 at 07:58

1 Answers1

2

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

gasche
  • 31,259
  • 3
  • 78
  • 100
  • the version of Batteries is 1.4.1. The system has two versions of OCaml which are 3.09 and 4.00. The 3.09 one is at /usr/.. and the other is at /home/xxx/OCaml. I do not have the authority to install it at the /usr/... path. – Canoe Nov 22 '12 at 07:00
  • File "libs/estring/pa_estring_top.ml", line 18, characters 15-44:. The pa_estring_top.ml code is here: – Canoe Nov 22 '12 at 07:05
  • let _ = let parse = !Toploop.parse_toplevel_phrase and lexbufs = ref [] in Toploop.parse_toplevel_phrase := ~ – Canoe Nov 22 '12 at 07:08
  • I have just realized that I can edit the command line by myself and make it run instead of autorun. Thanks a lot. The error is correct. But there is one other problem waiting for me. – Canoe Nov 22 '12 at 08:29