Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Unbound module and module type in dune build

$
0
0

Hi. Wanted to try out dune today with a basic project, but couldn’t get it working. Here is my project structure

test/
├── dune-project
├── test.opam
├── lib/
│   ├── dune
│   ├── greeter.ml
│   └── greeter.mli
├── bin/
│   ├── dune
│   └── main.ml

while doing dune build I got 2 errors.

 test  ᐅ  dune build            
File "lib/greeter.ml", line 1, characters 17-28:
Error: Unbound module type Greeter_sig
File "bin/main.ml", line 2, characters 2-15:
Error: Unbound module Greeter

Files in the lib folder

greeter.ml

module Greeter : Greeter_sig = struct
  let greet name =
    Printf.printf "Hello, %s!\n" name
end

greeter.mli

module type Greeter_sig = sig
  val greet : string -> unit
end

dune (the one in the lib directory)

(library
 (name test)
 (public_name test)
 (modules greeter) )

Now dune-project

(lang dune 2.8)

(name test)

and finally bin directory

main.ml

let () =
  Greeter.greet "World"

dune

(executable
 (name main)
 (libraries test))

Any ideas on how to fix it?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles