English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
What's the purpose of the static library?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Conway <cconway@c...>
Subject: Re: What's the purpose of the static library?

Richard Jones <rich <at> annexia.org> writes:
> <...>
> File: module.cmo ------------------------------
> 
> Contains the bytecode of the implementation of Module.
> 
> Created by: 'ocamlc -c module.ml'
> 
> Used: When linking bytecode programs, or creating bytecode libraries
> (*.cma), or by the toplevel when you use #load, or by Dynlink.
> 
> File: library.cma ------------------------------
> 
> This is just a set of *.cmo files combined together.
> 
> Created by: 'ocamlc -a'
> 
> Used: Same as for module.cmo

Richard,

This is a wonderful answer! It should go onto the wiki or in the FAQ. 
One nitpick...

.cma (and .cmxa) files should not be used for creating libraries 
(as .cmo and .cmx files can (and should) be). I.e., don't like a 
library into a library. Doing so will give a compiler error: 
    X.cma is not a compilation unit description.

Regards,
Chris