Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Compiler errors 接口上的不一致假设(Ocaml)_Compiler Errors_Ocaml - Fatal编程技术网

Compiler errors 接口上的不一致假设(Ocaml)

Compiler errors 接口上的不一致假设(Ocaml),compiler-errors,ocaml,Compiler Errors,Ocaml,我突然开始犯这个错误。我不知道如何诊断或修复它。我是否应该grep通过bar.ml并根据Big_int.mli中的签名检查每个Big_int函数 File "foo.ml", line 1, characters 0-1: Error: The files /home/bar.cmi and /usr/lib/ocaml/big_int.cmi make inconsistent assumptions over interface Big_int 通常,此消息表示

我突然开始犯这个错误。我不知道如何诊断或修复它。我是否应该grep通过
bar.ml
并根据
Big_int.mli
中的签名检查每个Big_int函数

File "foo.ml", line 1, characters 0-1:
Error: The files /home/bar.cmi
       and /usr/lib/ocaml/big_int.cmi make inconsistent assumptions
       over interface Big_int

通常,此消息表示最近重新编译了一个.mli文件,但另一个文件没有。由于OCaml库中有一个.mli文件,这可能意味着您已经升级了OCaml安装,但此后没有重新编译bar.mli


如果您只是重新编译bar.mli会发生什么情况?

rm bar.cmi
然后重试;看起来它是针对不同版本的
Big\u int

生成的,我已经尝试过了,同样的事情。我没有更新任何ocaml库。这个消息只是为了避免版本倾斜。它并没有告诉您代码是错误的,只是其中一些代码是根据过时的接口版本编译的。如果重新编译bar.mli真的不能解决问题,那么我唯一能想到的就是您的OCaml安装可能会出错。或者,您有两个不同的OCaml安装,它们相互冲突?