I started with an ocaml file Bataille.ml and finally decided to build a project with dune. The initial set up was as below :
Bataille
|---> Bataille.ml
Then I added the dune project:
PS H:\Ocaml\Bataille> cd ..
PS H:\Ocaml> dune init proj Bataille
which ended up with the following setup (untouched folders not detailed):
Bataille
|--_build
|--bin
|-->dune
|-->main.ml
|--lib
|--test
|-->Bataille.ml
|-->Bataille.open
|-->dune-project
I slightly modified the main.ml file so that it looks like that :
let monte_carlos () =
let n = 52 in
let (jeu1,jeu2) = Bataille.init([],[],n) in
List.iter jeu1 print_int;;
As highlighted by ocamllsp
, when I run a dune build
I get this error:
PS H:\OCaml\Bataille> dune build
File "bin/main.ml", line 4, characters 20-33:
4 | let (jeu1,jeu2) = Bataille.init([],[],n) in
^^^^^^^^^^^^^
Error: Unbound value Bataille.init
Which, as a dune beginner (and ocaml beginner as well, I shall confess) am not able to deal with.
I fear an issue with capital letters here or there, but … this is a mystery for me. I have red somewhere I would not have to declare my modules with dune, it will cope with it … I must have missinterpreted something.
Help appreciated.
5 posts - 3 participants