Mac - Compile program with dune

I got this program prog.ml :

open Base;;
open Batteries;;
let st = String.slice ~first:(1) ~last:(3) "ABCD";;
print_string st;;
...

My file dune :
(executable
 (name prog) 
(libraries /Users/xt/.opam/system/lib/Base /Users/xt/.opam/system/lib/Batteries) )

When I try: "dune build prog.exe" 
returns "Error: Library ... not found."

How to build the "dune" file to compile and create executable?

Try:

(executable
 (name prog) 
(libraries base batteries) )

mabye…

I use mac osx. I change file dune.
When i try “dune build prog.exe”
return
Error: Don’t know how to build prog.exe

what about dune build ./prog.exe?

returns the same error

See https://dune.build/ , it has a simple example of using dune. You can do something similar.

the “.exe” extension is only for windows i think

Nope, Dune uses it on all platforms.

File was in another directory. It is already running, thx.