0

I have two OCaml modules, namely nhc.ml and test.ml. Both of these modules reference parser.mly, scanner.mll and ast.mli.

The goal is to have one executable, namely nhc.native, where I can still reference the functions of test.ml.

./nhc.native fun_from_test

Separating the two modules separately works:

corebuild nhc.native  
corebuild test.native  

But when I try to use corebuild to link the two as follows:

corebuild nhc.native -mod test

I get the error:

Error: No implementations provided for the following modules:
     Scanner referenced from test.cmx
     Parser referenced from test.cmx

If I run the same command, without first mkaing the test executable (test.native), I get the following error:

File "_none_", line 1:
Error: Cannot find file test.cmx

How can I get the specified functionality?

camlspotter
  • 8,990
  • 23
  • 27
Abundance
  • 1,963
  • 3
  • 24
  • 46

1 Answers1

0

I'm not sure if there's a way to do the following with the compiler. But an alternative solution was to just open the module inside nhc.ml as follows:

open Test

and I get the behavior I wanted.

Abundance
  • 1,963
  • 3
  • 24
  • 46