22

I suddenly started to get this error. I don't know how to diagnose or fix it. Am I supposed to grep through bar.ml and check every Big_int function against signature in Big_int.mli?

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
pbp
  • 1,461
  • 17
  • 28

2 Answers2

24

Generally this message means that one .mli file has been recompiled recently but not the other. Since one of the .mli files is in your OCaml library, it might mean that you've upgraded your OCaml installation but haven't recompiled bar.mli since then.

What happens if you just recompile bar.mli?

Jeffrey Scofield
  • 65,646
  • 2
  • 72
  • 108
  • I already tried that, same thing. I didn't update any ocaml libs. – pbp Feb 06 '12 at 20:18
  • 4
    Well, this message is intended only to avoid version skew. It's not telling you that your code is wrong, only that some of it is compiled against an outdated version of an interface. If recompiling bar.mli really doesn't fix things, the only thing I can think of is that your OCaml installation might be messed up. Or maybe you have two different OCaml installations that are conflicting? – Jeffrey Scofield Feb 06 '12 at 20:32
5

rm bar.cmi and try again; it looks like it was generated against a different version of Big_int.

Asherah
  • 18,948
  • 5
  • 53
  • 72