[英](yet another) “Unbound module” error
The line 线
open Uutf
in my file mymod.ml
is causing the error shown below: 我的文件
mymod.ml
中导致出现以下错误:
% corebuild -quiet test.native
+ ocamlfind ocamlopt -c -w A-4-33-40-41-42-43-34-44 -strict-sequence -g -annot -bin-annot -short-paths -thread -syntax camlp4o -package bin_prot.syntax -package sexplib.syntax,comparelib.syntax,fieldslib.syntax,variantslib.syntax -package core -o mymod.cmx mymod.ml
File "mymod.ml", line 2, characters 5-9:
Error: Unbound module Uutf
I've previously installed Uutf
with 我以前安装
Uutf
与
% opam install uutf
What else is one supposed to do after running the opam install
command above? 运行上面的
opam install
命令后, opam install
?
PS: I have read several SE threads on OCaml "Unbounded module" errors, including PS:我已经阅读了关于OCaml“无界模块”错误的多个SE线程,包括
Ocaml unbound module Ocaml未绑定模块
Error: Unbound module ... in Ocaml 错误:Ocaml中未绑定的模块...
ocaml toplevel throws error unbounded module ocaml toplevel引发错误无界模块
Ocaml and Opam: unbound module Core Ocaml和Opam:未绑定的模块核心
...but none have answered my question. ...但是没有人回答我的问题。
just use 只是使用
corebuild -package uutf test.native
This will automatically (using ocamlfind
) find the dependend package and add all the needed flags. 这将自动(使用
ocamlfind
)找到dependend包并添加所有需要的标志。
You can query ocamlfind database with ocamlfind list
shell comand, to see what libraries are available. 您可以使用
ocamlfind list
shell ocamlfind list
查询ocamlfind数据库,以查看可用的库。 It is very handy if you're unsure about the library name. 如果您不确定库名称,这将非常方便。
Well, you use corebuild, i assume it's that script given the display. 好吧,您使用corebuild,我认为这是给定显示的脚本 。
You should try adding -lib uutf
in your command line so that your call to ocamlbuild knows it should link to it. 您应该尝试在命令行中添加
-lib uutf
,以便对ocamlbuild的调用知道它应该链接到它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.