错误:未绑定模块。。。在Ocaml中

错误:未绑定模块。。。在Ocaml中,ocaml,Ocaml,我刚刚安装了一个名为停机坪的库,安装似乎已完成: @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 ./loc

我刚刚安装了一个名为停机坪的库,安装似乎已完成:

@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
我尝试了第一个例子:

(* 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;;
...
但是,
ocaml-c file.ml
给我提供了
错误:未绑定的模块停机坪
发生在
开放停机坪


有人知道我为什么不能加载停机坪模块吗?多谢各位

我应该用“-I”选项指示停机坪库的路径。由于它安装在OCaml的标准库中,您只需使用以下工具进行编译:

ocamlc-I+apter-c file.ml


我应该用“-I”选项指示停机坪库的路径。由于它安装在OCaml的标准库中,您只需使用以下工具进行编译:

ocamlc-I+apter-c file.ml


谢谢你的回复。。。我已经尝试了
ocamlc-I+apter-c file.ml
,但仍然存在相同的错误。。。我还尝试了
ocamlc-I/usr/lib/apore-c file.ml
ocamlc-I/usr/lib-c file.ml
,它们也不起作用。。。你明白为什么了吗?为什么
/usr/lib/apter
会起作用?您甚至没有在该目录中安装停机坪caml绑定。请尝试找到停机坪的caml绑定所在目录的完整路径。@nlucaroni,谢谢您的评论,我运行
ocamlc-I/usr/local/lib/ocaml/3.11.2/porator-I/usr/local/lib/ocaml/3.11.2/gmp/-c file.ml
,效果更好。如果您知道简化该命令的方法,请告诉我…请尝试findlib或使用Makefile/configure脚本来缓存路径。如果库安装在/usr/lib/ocaml/aproter和/usr/lib/gmp中,则“I+aproter-I+gmp”是正确的。linux发行版中没有包含这些库的包吗?安装将更加标准。您也可以通过godi安装ocaml和所有其他库谢谢您的回复。。。我已经尝试了
ocamlc-I+apter-c file.ml
,但仍然存在相同的错误。。。我还尝试了
ocamlc-I/usr/lib/apore-c file.ml
ocamlc-I/usr/lib-c file.ml
,它们也不起作用。。。你明白为什么了吗?为什么
/usr/lib/apter
会起作用?您甚至没有在该目录中安装停机坪caml绑定。请尝试找到停机坪的caml绑定所在目录的完整路径。@nlucaroni,谢谢您的评论,我运行
ocamlc-I/usr/local/lib/ocaml/3.11.2/porator-I/usr/local/lib/ocaml/3.11.2/gmp/-c file.ml
,效果更好。如果您知道简化该命令的方法,请告诉我…请尝试findlib或使用Makefile/configure脚本来缓存路径。如果库安装在/usr/lib/ocaml/aproter和/usr/lib/gmp中,则“I+aproter-I+gmp”是正确的。linux发行版中没有包含这些库的包吗?安装将更加标准。您还可以通过godi安装ocaml和所有其他库