Try dune build ./scanner.exe (need a leading ./ for executables in the current directory). I believe there is a hint for this… not sure why you’re not getting it with your setup.
If that doesn’t work, can you post the dune file you’re using?
Executables must be specified inside (executable ...) stanzas in a dune file in the same directory as the executable.
In src/scanner-adhoc/dune, you define the executable scanner-test, but no executable for the scanner module, hence the error message. You could add a new stanza for scanner, but then Dune will require you to specify which modules belong to which executables (which is a problem for your case, since scanner-test requires code supplied by scanner).
If you want to define some common code that’s used by two executables, you should use a single library stanza and two executable stanzas that depend on it:
This will have the advantage of keeping your library code (scanner) distinct from the run-time side-effects that it currently defines. (If you didn’t do this, any code that depends on Scanner (in this case, scanner-test) would end up inheriting its run-time side-effects too.) Even better, you could split the scanner-adhoc folder into lib/, bin/ and test/ (each with their own dune file), and then you wouldn’t need to tell Dune which modules correspond to which build artefacts.
Thanks @CraigFe. I understood how the build works!! And i separated the files in distint folders. Now i’m ready to resolved my asks about the implementation. Thanks again!!