Learning dune build system (GitHub). In doing the sum example from Real World OCaml (the instructions did not work as written but the code is valid) was able to build an executable. To avoid all of the potential problems I read about running OCaml on Windows natively ran using WSL 2.
Here, dune exec sum is calling /usr/bin/sum (it found sum in your PATH) which is an unrelated binary. To execute bin/sum.exe, use dune exec bin/sum.exe (it would be possible to use dune exec sum if this binary was defined as a public executable, ie was part of an opam package which installed it as sum).
I don’t have the environment that created the problem set up at the moment to work through as an exercise but when I do I will try to report back here. It could be days or more. I am way deep into another Problem with Prolog.