简体   繁体   中英

OCamlbuild not resolving subdirectory dependency

I have an OCaml project and I'm running into a weird issue.

The directory structure looks like this:

./tests
    test.ml
    templatetest.ml
./src
    template.ml
    ...
    andsoforth.ml

I am building it like this:

ocamlbuild -Is src,tests tests/test.native

Key point being, tests/test.ml depends on tests/templatetest.ml.

When I build it, I get:

+ /usr/local/bin/ocamlc.opt -c -I tests -I src -o tests/test.cmo tests/test.ml
File "tests/test.ml", line 1, characters 0-17:
Error: Unbound module TemplateTest
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.

I tried adding a _tags file in the top directory containing:

<src> or <tests>: include

That still produced the same error. (I believe ocamlbuild tests/test.native with the _tags file is the exact same thing as the previous build line I used.)

I also created an empty _tags file in both ./tests and ./src, but that didn't change anything either.

Any suggestions? If you need, the entire source is here . Just run make test . Thanks!

It a funny issue: not TemplateTest but Templatetest . For the former name, you module file should be named templateTest.ml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM