简体   繁体   English

OCaml CSV模块 - 错误:未绑定模块Csv

[英]OCaml CSV module - ERROR: Unbound Module Csv

I have installed the OCaml CSV module in C:\\OCaml\\lib. 我在OC:\\ OCaml \\ lib中安装了OCaml CSV模块。 When I run the following code in the top level open Csv;; 当我在顶层运行以下代码时open Csv;;

I receive the error message Error: Unbound module Csv 我收到错误消息Error: Unbound module Csv

I am not sure why the module is not loading. 我不知道为什么模块没有加载。 Thanks 谢谢

There are two steps involved. 涉及两个步骤。 First you need to make sure that CSV loaded into your toplevel, then you can open it. 首先,您需要确保将CSV加载到您的顶层,然后您可以打开它。 I don't use windows, but under OS X it looks like this: 我不使用Windows,但在OS X下它看起来像这样:

$ ocaml
    OCaml version 4.00.1

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

I just found the solution. 我刚刚找到了解决方案。 I did not compile the csv.ml and csv.mli files. 我没有编译csv.ml和csv.mli文件。

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 如果其他人有这个问题,这里是修复问题的步骤:1)在命令行中转到.am和.mli文件所在的OCaml \\ lib目录2)运行命令ocamlc -c modulename.mliocamlc -c modulename.ml

in the toplevel you can now run open modulename;; 在顶层你现在可以运行open modulename;;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM