我正在尝试将lwt模块与Ocaml一起使用
%cat .ocamlinit
#use "topfind";;
#require "lwt.simple-top";;
#require "lwt.syntax";;
#require "findlib";;
#require "num.core";;
#load "nums.cma";;
#load "unix.cma";;
#camlp4o;;
open Lwt;;
open Lwt_io;;当我尝试使用任何Lwt构建"ocamlbuild - use -ocamlfind myFile.native“时,请使用以下命令
我收到这个错误:"Error: Unbound module Lwt“
当我输入终端%ocaml时,它加载成功,并且我可以使用Lwt.API的
怎么一回事?有什么建议吗?
发布于 2012-12-27 21:04:16
ocamlbuild不读取.ocamlinit,它纯粹是用于顶层(即ocaml)。为了编译依赖于lwt的项目,您需要指定依赖项,例如:
ocamlbuild -use-ocamlfind -package lwt myFile.nativehttps://stackoverflow.com/questions/14053647
复制相似问题