title: Ocaml can't find Unix module
body: <p>I (re-)installed Ocaml on OS X using the following steps:</p>
  
  <pre><code>&gt; brew uninstall ocaml
  &gt; brew uninstall opam
  &gt; brew install ocaml
  &gt; brew install opam
  &gt; opam init
  &gt; eval `opam config env`
  &gt; opam switch 4.02.1
  &gt; opam install batteries core
  </code></pre>
  
  <p>I then tried to compile this program:</p>
  
  <pre><code>open Unix
  open Printf
  
  let main () =
      match fork () with
      | 0 -&gt; printf "child\n"
      | pid -&gt; printf "parent\n"
  
  let _ = main ()
  </code></pre>
  
  <p>I compiled using this command:</p>
  
  <pre><code>ocamlc -o fork fork.ml
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>File "fork.ml", line 1:
  Error: Error while linking fork.cmo:
  Reference to undefined global `Unix'
  </code></pre>
  
  <p>In fact, I was getting this error before reinstalling; that is why I reinstalled in the first place. But the problem persists and I am not sure how to fix it.</p>