我在Windows上使用cygwin 64终端并且想编译这个ocaml图形代码。 它保存为.ml类型:如何编译ocaml图形窗口cygwin
let etat x y c=draw_circle x y 10 ;let a=(x-5) and b=(y-5) in moveto a b ;let s=string_of_int c in draw_string s;;
etat 100 100 1;;
etat 200 200 3;;
我之间困惑:负载graphics.cma打开图形Graphics.open_graph
而且,我也要用ocamlc -og graphics.cma g.ml 到编译?
使用ocamlbuild来构建您的项目:ocamlbuild -use-ocamlfind -pkg graphics .native。它将解决依赖关系。它将链接到graphics.cma;在你的代码中,你需要通过打开这个模块来引用那个模块的功能,或者通过在Graphics前面加上前缀来明确地给出命名空间。 –