0
votes

I have installed the OCaml CSV module in C:\OCaml\lib. When I run the following code in the top level open Csv;;

I receive the error message Error: Unbound module Csv

I am not sure why the module is not loading. Thanks

2

2 Answers

1
votes

There are two steps involved. First you need to make sure that CSV loaded into your toplevel, then you can open it. I don't use windows, but under OS X it looks like this:

$ ocaml
    OCaml version 4.00.1

# #load "unix.cma";;
# open Unix;;
# stat;;
- : string -> Unix.stats = <fun>
# 
1
votes

I just found the solution. I did not compile the csv.ml and csv.mli files.

If anybody else has this problem here are the steps to fix the problem: 1) In the command line go to the OCaml\lib directory where your .ml and .mli files are located 2) Run the commands ocamlc -c modulename.mli and ocamlc -c modulename.ml

in the toplevel you can now run open modulename;;