ocamlocaml-core

No implementations provided for the following modules


I'm having a problem with corebuild. I have written the following program:

open Core.Std
open Smtp

type person = {
  name: string;
  address: Smtp_unix.Addr.t
}

let send p1 p2 =
  Smtp_unix.sendmail ~host:"gmail.google.fr"
    ~name:"gmail.google.com"
    ~from:(Smtp_unix.Addr.of_string "<hidden>")
    ~to_:[p1.address]
    ~body:("Hello "^p2.name)
    ()

let () =
  let p1 = {name="alice"; address = Smtp_unix.Addr.of_string "alice@example.com"} in
  let p2 = {name="bob"; address = Smtp_unix.Addr.of_string "bob@example.com"} in
  match send p1 p2 with
  | `Ok _ -> printf "Mail sent"
  | `Failure (_,m) -> printf "Error: %s" m

which according to Merlin is correct. To compile it, I run the following command

corebuild example.native -package smtp

and I get the following error, which I don't understand.

Error: No implementations provided for the following modules:
         Smtp_unix referenced from example.cmx

I don't get what is wrong. Any idea?


Solution

  • Looks like smtp_unix is needed for smtp.

    corebuild send.native -package smtp.unix -package smtp