我有一個函數來獲取當前時間使用unix gettimeofday()函數time.ml。該文件訪問功能以下列方式:在OCaml中使用Unix函數源
open Unix; (*declared at the top of the file*)
let get_time() = Unix.gettimeofday()
在.mli文件中的相應條目是這樣的:
File "_none_", line 1, characters 0-1:
No implementations provided for the following modules:
Unix referenced from time.cmx
:
val get_time : unit -> float
但編譯它們拋出一個錯誤時
我已檢查以下文件是否存在於/lib/ocaml目錄中:
unix.cmi, unix.a unix.cma unix.cmx unix.cmxa unix.cmxs unix.mli
和路徑設置正確設置爲的.bashrc文件。
LD_LIBRARY_PATH=~/lib
其他功能,如fprintf中從printf的模塊正常工作inspite在同一/LIB/ocaml的目錄之中。
任何想法可能是錯的?我做錯了什麼,或者我錯過了什麼?
做到了!謝謝! –