Re: OCaml: problems compiling

Xavier Leroy (Xavier.Leroy@inria.fr)
Mon, 21 Jul 1997 18:02:43 +0200 (MET DST)

From: Xavier Leroy <Xavier.Leroy@inria.fr>
Message-Id: <199707211602.SAA29043@pauillac.inria.fr>
Subject: Re: OCaml: problems compiling
In-Reply-To: <199707180021.KAA00023@seedknee.socs.uts.EDU.AU> from "Paul A. Steckler" at "Jul 18, 97 10:21:51 am"
To: steck@socs.uts.EDU.AU
Date: Mon, 21 Jul 1997 18:02:43 +0200 (MET DST)

> Frequently when compiling a file foo.ml files with ocamlopt
> on a Sun Sparc, I get a message like:
>
> I/O error: foo.cmi: No such file or directory
>
> Note that it's complaining about the .cmi file for the
> file currently being compiled, not some other module.
>
> How can I avoid the error to begin with?

You should compile the foo.mli file before compiling the foo.ml file.
That will produce the missing foo.cmi file.

Alternatively, if you don't have an interface file foo.mli in the same
directory as foo.ml, the compiler will create foo.cmi directly from
foo.ml.

I agree that a better error message is in order.

Regards,

- Xavier Leroy