2017-05-23 61 views
0

什麼我現在所擁有的:如何正確地將str模塊添加到oasis config?

_oasis文件:

OASISFormat: 0.4 
Name:  Count Lines 
Version:  0.0.1 
Synopsis: Counts the number of lines in the project 
Authors:  Bogdan Nechyporenko 
License:  LGPL-2.1 with OCaml linking exception 
Executable "count-lines" 
    Path:  src 
    BuildTools: ocamlbuild 
    BuildDepends: str 
    MainIs:  main.ml 

的src/main.ml:

open Str ;; 

let endswith s1 s2 = 
    let re = Str.regexp (Str.quote s2^"$") 
    in 
    try ignore (Str.search_forward re s1 0); true 
    with Not_found -> false 

我運行命令來構建它:

ocaml setup.ml -build 

其餘的只是由ocaml -setup生成的文件: enter image description here

而當我建立查看下一個錯誤: enter image description here

回答

1

如果有人感興趣的答案,修改自己的_oasis文件後,你需要運行「綠洲設置」拿起修改。

愚蠢的我,感謝Drup在IRC#ocaml聊天!

相關問題