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
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>> writes:
> <...>
> File: module.cmo ------------------------------
> Contains the bytecode of the implementation of Module.
> Created by: 'ocamlc -c'
> 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.