English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2008-09-23 (12:50)
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


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.