Wojtek
Wojtek

Reputation: 2524

OCaIDE can't create .cmo files (compile modules)

I have problem with OCaIDE under Eclipse Indigo. I've got a new OCaml Managed Project and in that a few modules. Here's how it looks in my workspace explorer:
workspace explorer
All those files have errors (.mli files were automatically created), that sound (for instance for the file accum.ml)
Error: I/O error: lab2/accum.cmo: No such file or directory
and indeed there are no such files in the directory. I just can't get OCaIDE to create those files. I've tried automatic build, manual build, clean, anything I could think of. The OCaml paths set in the plugin configuration seem to be alright, because the toplevel interpreter works fine.

Additionally, here are some of the files from the project:
accum.ml:

let reverseInt n =
let rec reverseAccum n accum = match n with
| 0 -> accum
| n -> reverseAccum (n/10) (10*accum + (n mod 10))
in reverseAccum n 0

.project:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>lab2</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>Ocaml.ocamlbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>ocaml.ocamlnature</nature>
    </natures>
</projectDescription>

.paths:

.
/usr/lib/ocaml

I would really appreciate your help.

Edit: Maybe it's also important, I use Ubuntu 12.04 64 bit and OCaml 3.12.1

Edit2: Here's some compiler output:

Building: lab2/simple.mli
File "lab2/simple.mli", line 1, characters 0-1:
Error: I/O error: lab2/simple.mli: No such file or directory

Building: lab2/simple.ml
File "lab2/simple.ml", line 1, characters 0-1:
Error: I/O error: lab2/simple.cmo: No such file or directory

Building: lab2/lists.mli
File "lab2/lists.mli", line 1, characters 0-1:
Error: I/O error: lab2/lists.mli: No such file or directory

Building: lab2/lists.ml
File "lab2/lists.ml", line 1, characters 0-1:
Error: I/O error: lab2/lists.cmo: No such file or directory

Building: lab2/bst.mli
File "lab2/bst.mli", line 1, characters 0-1:
Error: I/O error: lab2/bst.mli: No such file or directory

Building: lab2/bst.ml
File "lab2/bst.ml", line 1, characters 0-1:
Error: I/O error: lab2/bst.cmo: No such file or directory

Building: lab2/accum.mli
File "lab2/accum.mli", line 1, characters 0-1:
Error: I/O error: lab2/accum.mli: No such file or directory

Building: lab2/accum.ml
File "lab2/accum.ml", line 1, characters 0-1:
Error: I/O error: lab2/accum.cmo: No such file or directory

Upvotes: 2

Views: 940

Answers (1)

Wojtek
Wojtek

Reputation: 2524

It seems like the problem was caused by my strange approach to creating OCaml projects - I created them outside the Eclipse workspace.

I've found this topic and they say, that OcaIDE (and apparently Eclipse in general) tries not to mingle with folders outside its workspace. Therefore it won't automatically create interfaces, compilation units, etc. if the project is not in the workspace folder.

I re-created my project, this time in the workspace, and everything went alright. I can even rename already created files and all their references (mli, cmo) get updated.

Upvotes: 1

Related Questions