title: Error linking module in ocaml
body: <p>I am a complete beginner with Ocaml programming and I am having trouble linking a module into my program. Actually I am doing some regular expression checking and I have written a function that basically tokenizes a string based on a separator string using the <a href="http://caml.inria.fr/pub/docs/manual-ocaml-4.00/libref/Str.html">Str module</a> . So i use the functions defined in the library like this:</p>
  
  <pre><code>Str.regexp_string /*and so on*/
  </code></pre>
  
  <p>However, when I try to compile the ml file, I get an error suggesting that I have an undefined global <strong>Str</strong> . We use <em>List</em> functions by typing in List.length and so on just like I did for Str without having to explicitly include the specific module. I tried </p>
  
  <pre><code>open Str;;
  include Str;; /*None of these work and I still get the same error*/
  </code></pre>
  
  <p>However if in the toplevel I use</p>
  
  <pre><code>load "str.cma" /*Then the program works without problems*/
  </code></pre>
  
  <p>I want to include the module in the ml file because I have to in the end link 3 cmo's to get the final executable(which is not run in the toplevel). I know this is a really basic question but I am having trouble solving it. Thanks in advance.</p>