没有为以下模块提供实现
问题描述:
我遇到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
我不明白什么是错的。任何想法?
答
看起来smtp_unix是需要smtp。
corebuild send.native -package smtp.unix -package smtp
哦,我不知道我可以做那件事。我应该在哪里找到包裹的结构? – RichouHunter
我不知道这是否有工具。我所做的就是我使用了utop并尝试了你的代码。然后我尝试添加新库(使用#require指令和utop底部给出的可用库列表 - 查找以s开头的库)。所以不是火箭科学,但它有帮助;) –