Creating an executable depending on a local library with dune

I am stuck trying to create (with dune) an executable that uses my homemade library.

Here is my setup : my root directory has a dune-project file, a lib/ and a /bin subdirectory. Each of those directories has a dune file.

My dune-project file :

lang dune 3.16)

(name my_main)

(generate_opam_files true)

(source
 (github username/reponame))

(authors "Author Name")

(maintainers "Maintainer Name")

(license LICENSE)

(documentation https://url/to/documentation)

(package
 (name my_main)
 (synopsis "A short synopsis")
 (description "A longer description")
 (depends ocaml dune)
 (tags
  (topics "to describe" your project)))

; See the complete stanza docs at https://dune.readthedocs.io/en/stable/dune-files.html#dune-project

My lib/dune file :

(include_subdirs unqualified)

(library
(flags -w +1..31+33..69+71+72)
(name my_main_lib)
(libraries str unix zarith)
)

My bin/dune file :

(executable
 (public_name cepdf)
 (name cepdf_executable)
 (libraries my_main_lib))

My bin/cepdf_executable.ml file :

let () = Executable_coherent_pdf.main (Sys.argv())

I get the following error message :

$ dune exec cepdf
Entering directory '/home/jonathandoyle/OCaml/my_main'
File "bin/cepdf_executable.ml", line 1, characters 9-37:
1 | let () = Executable_coherent_pdf.main (Sys.argv())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Unbound module Executable_coherent_pdf

What did I do wrong ? (By the way, the module Executable_coherent_pdf is indeed a valid module in my library)

Your library should be visible from your executable as My_main_lib (or whichever name you choose for your library in your lib/dune file). So, if a module Executable_coherent_pdf is defined in your library you should be able to write in your executable file:

let () = My_main_lib.Executable_coherent_pdf.main (Sys.argv())

Thank you! (and by the way, there was also a minor typo in my code, it should be (Sys.argv) not (Sys.argv())