2017-05-23 47 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聊天!

相关问题