[英]Error: Unbound module … in Ocaml
I have just installed a library called Apron
, the installation seems to be done: 我刚刚安装了一个名为Apron
的库,安装似乎已完成:
@ubuntu$ find -name "*apron*"
./lib/libapron_debug.so
./lib/libapron.a
./lib/libapron.so
./lib/libapron_debug.a
./local/lib/ocaml/3.11.2/stublibs/dllapron_caml.so.owner
./local/lib/ocaml/3.11.2/stublibs/dllapron_caml.so
./local/lib/ocaml/3.11.2/apron
./local/lib/ocaml/3.11.2/apron/libapron_caml_debug.a
./local/lib/ocaml/3.11.2/apron/apron.cmxa
./local/lib/ocaml/3.11.2/apron/libapron_caml.a
./local/lib/ocaml/3.11.2/apron/apron.cmi
./local/lib/ocaml/3.11.2/apron/apron.cmx
./local/lib/ocaml/3.11.2/apron/apron.a
./local/lib/ocaml/3.11.2/apron/apron.cma
And I tried a first example: 我尝试了第一个示例:
(* with default setting:
apronppltop -I $MLGMPIDL_INSTALL/lib -I $APRON_INSTALL/lib
#load "gmp.cma";;
#load "apron.cma";;
#load "box.cma";;
#load "oct.cma";;
#load "polka.cma";;
#load "ppl.cma";;
#load "polkaGrid.cma";;
#install_printer Apron.Linexpr1.print;;
#install_printer Apron.Texpr1.print;;
#install_printer Apron.Lincons1.print;;
#install_printer Apron.Generator1.print;;
#install_printer Apron.Abstract1.print;;
let environment_print fmt x = Apron.Environment.print fmt x;;
let lincons1_array_print fmt x = Apron.Lincons1.array_print fmt x;;
let generator1_array_print fmt x = Apron.Generator1.array_print fmt x;;
#install_printer Apron.Var.print;;
#install_printer environment_print;;
#install_printer lincons1_array_print;;
#install_printer generator1_array_print;; *)
open Apron;;
...
However ocaml -c file.ml
gives me Error: Unbound module Apron
which happens on open Apron;;
但是ocaml -c file.ml
给了我Error: Unbound module Apron
,发生在open Apron;;
Does anyone know why I could not load the Apron module? 有谁知道为什么我无法加载围裙模块? Thank you very much! 非常感谢你!
I should indicate the path of the Apron library with '-I' options. 我应该使用“ -I”选项指示围裙库的路径。 As it is installed in the standard library of OCaml, you only need to compile with: 由于它已安装在OCaml的标准库中,因此您只需使用以下代码进行编译:
ocamlc -I +apron -c file.ml ocamlc -I +围裙-c file.ml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.