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
[Caml-list] Question about linking and module initialization
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Question about linking and module initialization

Yamagata Yoriyuki wrote:

>>$ ocamlc -o app app.cma
> In this case, modules only used from the main program are linked.
> Since you don't provide anything except app.cma, I guess nothing is
> linked.

Ah, this is the point. I did not realize that modules in a 
library would be selected at linking time by ocamlc.

> Initialization is done by the linking order of modules in
> app.cma.

This is what I thought, but I did not realize that my 
executable would be entirely empty of modules.

> Everything is explained in the ocamlc section of the manual.

I had read it already, but I happened to overlook the fact 
that modules in libraries are linked only if referenced 
somewhere in the cmo files.

Thank you very much.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: