我尝试安装 extlib-1.4 但出现错误(我是菜鸟) 我输入
ocaml install.ml
并得到:
File "bitSet.ml", line 23, characters 40-53:
23 | let bcreate : int -> intern = Obj.magic String.create
^^^^^^^^^^^^^
Alert deprecated: Stdlib.String.create
Use Bytes.create/BytesLabels.create instead.
File "bitSet.ml", line 28, characters 64-75:
28 | let fast_fill : intern -> int -> int -> int -> unit = Obj.magic String.fill
^^^^^^^^^^^
Alert deprecated: Stdlib.String.fill
Use Bytes.fill/BytesLabels.fill instead.
ocamlc -c dynArray.ml
ocamlc -c extHashtbl.ml
File "extHashtbl.ml", line 1:
Error: The implementation extHashtbl.ml
does not match the interface extHashtbl.cmi: ... In module Hashtbl:
Values do not match:
val create : ?random:bool -> int -> ('a, 'b) t
is not included in
val create : int -> ('a, 'b) t
File "extHashtbl.mli", line 76, characters 1-31: Expected declaration
File "hashtbl.mli", lines 31-32, characters 0-30: Actual declaration
Exit Code 2 - Stopped
不明白为什么ocaml要关注String.create和String.fill 我不知道为什么它没有实现 extHashtbl.ml 我需要 RLDev 的 findlib 的确切版本,但它看起来对于 ocaml 来说太旧了(或者这个版本的 ocaml 不适合)
extlib 1.4 版本已经过时了。 extlib 的 opam 页面显示版本 1.5.2 可以追溯到 2013 年 11 月或差不多 11 年前。
自那时以来,extlib 寻求扩展的标准库已经发生了变化,并且您几乎肯定不会使用很久以前的 OCaml 编译器和标准库(我希望不会!)。您看到的警告和错误几乎肯定源自这些差异。安装 OCaml 软件包的理想方法是 OCaml 软件包管理器,
opam。