What is an unbound module error?

#1

may i know what it means when i have unbound module error?

0 Likes

#2

It means the compiler doesn’t know about this module:

$ ocaml
# let x = X.x;;
Error: Unbound module X
0 Likes

#3

i am trying to compile a ocaml program (part of it shown below)

open Ocamlbuild_plugin
open Command

(** helper functions )
(
splitting strings using a delimeter character *)
let rec strsplit sep str accu len =
try let idx = String.rindex_from str (len - 1) sep in
strsplit sep str ((String.sub str (idx + 1) (len - 1 - idx)) :: accu) idx
with Not_found -> (String.sub str 0 len) :: accu
let strsplit sep str = strsplit sep str [] (String.length str)

(** initializing variables from the environment *)
let host = Ocamlbuild_pack.Ocamlbuild_Myocamlbuild_config.system

the last line is causing unbound module error. What can i do? thanks

0 Likes

#4

There is no such module in the Ocamlbuild library as Ocamlbuild_pack.Ocamlbuild_Myocamlbuild_config.system. There is however Ocamlbuild_pack.Ocamlbuild_config, so most likely this is what you meant

let host = Ocamlbuild_pack.Ocamlbuild_config.system
0 Likes