1

I'm writing an OCaml program that I want to be organized, so I have this directory structure:

src
 |- folder1
 |   |- a.ml
 |- folder2
 |   |- b.ml

Note: b.ml uses open A to reference a.ml.

I want to test my code to see if it works. I have successfully run ocamlbuild a.native while in the folder1 directory. When I tried doing the same thing in the folder2 directory with b.ml, I got an error saying that the module A was unbound.

I have tried doing it from the src directory with the same result.

Can anyone please point out to me what I'm doing wrong?

1 Answers1

0

I found an answer:

Add a _tags file to the src folder, so the structure looks like this:

src
 |- folder1
 |   |- a.ml
 |- folder2
 |   |- b.ml
 |- _tags

Then modify the _tags file to include the following:

<folder1> or <folder2>: include

Then run ocamlbuild folder2/b.native from the src directory.