這是我基於ocamlbuild項目結構:單OCaml的模塊導致大約接口不一致的假設
_tags.ml:
true: package(batteries)
Main.mlpack
Stream
主/ Stream.ml
module MyStream = BatStream
I a米試圖編譯使用
ocamlbuild -use-ocamlfind Main.cmo
錯誤消息Main
模塊似乎相當不合邏輯對我說:
+ ocamlfind ocamlc -pack Main/Stream.cmo -o Main.cmo
File "_none_", line 1:
Error: The files Main/Stream.cmi and Main/Stream.cmi
make inconsistent assumptions over interface Stream
Command exited with code 2.
Compilation unsuccessful after building 3 targets (0 cached) in 00:00:00
這是從OPAM使用的OCaml 4.02.1。
這隻發生在與電池連接時,所以我只能算出Batteries.Stream
和Main.Stream
之間有衝突。事實上,如果我添加更多的模塊與依賴關係,我可以得到一個消息像
Error: The files /home/ken/.opam/4.02.1/lib/batteries/batteries.cmi
and Main/Stream.cmi make inconsistent assumptions
over interface Stream
不過,我不希望子模塊發生衝突。
這是怎麼發生的?對我來說,模塊可能會通過接口與自身發生衝突,這似乎是不可能的。
你有沒有嘗試過清理(即'室射頻_build')? – Drup
@Drup的確如此。包含這三個文件的新項目將生成給定的錯誤。 –