Version française
Home     About     Download     Resources     Contact us    
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.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners