Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCaml: problems compiling
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: OCaml: problems compiling
> 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