title: OCaml cross linking
body: <p>how does referenced linking work in OCaml?</p>
  
  <p>Example, let's assume I have 3 modules declared as</p>
  
  <ul>
  <li><code>A.ml</code></li>
  <li><code>B.ml</code></li>
  <li><code>C.ml</code></li>
  </ul>
  
  <p>of which</p>
  
  <ul>
  <li><code>A</code> needs <code>B</code> and <code>C</code></li>
  <li><code>B</code> needs <code>A</code></li>
  </ul>
  
  <p>How should I proceed in compiling?</p>
  
  <p>Since order is relevant using <code>ocamlc</code> or <code>ocamlopt</code> how can I fix the cross reference between <code>B</code> and <code>A</code>?</p>
  
  <p>I'm trying to first compile them all into <code>.cmo</code> with <code>ocamlc -c</code> and then link all of them together but with no success since swapping arguments will just move a problem from a module to another.</p>
  
  <p>The specific error is:</p>
  
  <blockquote>
    <p>Error: Error while linking A.cmo:
    Reference to undefined global `B'</p>
  </blockquote>
  
  <p>(or viceversa, if I swap the order of the args)</p>
  
  <p>I thinks this is an easy question but I'm unable to solve it.. thanks in advance</p>