user655617
user655617

Reputation: 348

OCaml : cil.cmi is not a compiled interface error

I am compiling an instrumentation framework written in OCaml and am a novice in interpreting OCaml. I receive this error when running scons :

ocamlc.opt -dtypes -I instrumentor -I ocaml -I ./cbi/cil/cil-1.4.0/obj/x86_LINUX 
-w Ael -warn-error A -o instrumentor/phase.cmi -c instrumentor/phase.mli

File "instrumentor/phase.mli", line 1, characters 0-1:
Error: /u/j/o/joy/Desktop/cbi/cil/cil-1.4.0/obj/x86_LINUX/cil.cmi
is not a compiled interface

Contents of instrumentor/phase.mli:

type phase = string * (Cil.file -> unit)

I am using OCaml 3.11.1. It would be helpful if you can give hints to fix this error.


As @gasche mentioned below : The error is probably due to version mismatch between the compilers used. This link http://ocaml.org/tutorials/common_error_messages.html has some more information and list of other common errors.

Upvotes: 1

Views: 2543

Answers (1)

gasche
gasche

Reputation: 31469

Wild guesses, but this could either be:

  • a problem in your build system that copies an irrelevant file into a .cmi; could you look at the content of the problematic cil.cmi to see if it's something obviously not a cmi (eg. a text file). You can also use ocamlobjinfo <file> to get information about files when they really are in an OCaml format

  • a version discrepancy between the compiled files of Cil and the compiler version you are using for your project (I would expect the compiler to recognize that this is a valid cmi with a wrong version number, and put a more informative error message, but you never know). Make sure the cil files have been produced with the same version of OCaml than you are currently using.

Upvotes: 2

Related Questions