【发布时间】:2022-01-23 08:31:47
【问题描述】:
我写了一个Ocaml文件,它只包含一行代码:open Findlib,然后我保存文件并命名为test.ml。在Ocaml64(Ocaml for windows)环境中,我输入命令ocamlc -o test test.ml,有一个错误:Error:Unbound module Findlib。
但是如果我打开 ocaml 交互环境并这样做:
$ ocaml
OCaml version 4.12.0
# #use "topfind"
;;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#predicates "p,q,...";; to set these predicates
Topfind.reset();; to force that packages will be reloaded
#thread;; to enable threads
# open Findlib;;
#
它可以工作,所以我确定Findlib库存在,我不知道为什么当我编译包含open findlib的文件时会发生错误。
【问题讨论】:
标签: compiler-errors ocaml ocamlfind