我找到一个程序使用模块Location,我用ocamlc编译它,但得到错误:
未绑定模块位置
我试试这个:opam 安装位置
get:找不到名为"位置"的包
那么如何使用模块位置?
我发现它非常困难和无聊,文档也不好,文档
https://caml.inria.fr/pub/docs/manual-ocaml/libref/Location.html
不要告诉我需要使用 opam 安装的软件包名称
那么如何使用模块位置?谢谢!
你可以用-package compiler-libs.common
编译它。
例如,要编译具有以下内容的Main.ml
:
let () =
print_string !Location.input_name
使用此命令:
ocamlbuild -package compiler-libs.common Main.native
还要检查这个。