Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
How to define submodules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-07-21 (12:01)
From: Jean-Christophe Filliatre <filliatr@l...>
Subject: Re: [Caml-list] How to define submodules

Jozef Kosoru writes:
 > OK, and then I want to compile it (within a root directory):
 > 	$ ocamlc -c Kernel/Parser/
 > 	$ ocamlc -I . Kernel/Parser/pdf.cmo -o app
 > 	File "", line 1, characters 0-22:
 > 	Unbound value Kernel.Parser.Pdf.init
 > Is this supposed to work somehow?


First, to compile you need to pass  "-I Kernel/Parser" to the
compiler, because it needs to find the file pdf.cmi.

Second,  in  you  have   to  write  "Pdf.init"   instead  of
"Kernel.Parser.Pdf.init" because the directory structure is not turned
into a module structure in ocaml.

However, you can use the option -pack and -for-pack of the compiler to
pack several  files as submodules of  a new module; see  the manual at