2
我遇到corebuild
問題。我寫了以下程序:沒有爲以下模塊提供實現
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 "[email protected]"} in
let p2 = {name="bob"; address = Smtp_unix.Addr.of_string "[email protected]"} in
match send p1 p2 with
| `Ok _ -> printf "Mail sent"
| `Failure (_,m) -> printf "Error: %s" m
哪個根據Merlin
是正確的。編譯它,我運行以下命令
corebuild example.native -package smtp
我得到以下錯誤,我不明白。
Error: No implementations provided for the following modules:
Smtp_unix referenced from example.cmx
我不明白什麼是錯的。任何想法?
哦,我不知道我可以做那件事。我應該在哪裏找到包裹的結構? – RichouHunter
我不知道這是否有工具。我所做的就是我使用了utop並嘗試了你的代碼。然後我嘗試添加新庫(使用#require指令和utop底部給出的可用庫列表 - 查找以s開頭的庫)。所以不是火箭科學,但它有幫助;) –