我是 ocaml 的新手,我一直收到这个错误,但不明白为什么。
这是我的ocaml代码:
#load "graphics";;
open Graphics;;
open_graph "";;
let etoile x y c =
moveto (x-c/2) (y-c/2) ;
lineto (x-c/4) y ;
lineto (x-c/2) (y+c/2) ;
lineto x (y+c/2) ;
lineto (x+c/2) (y+c/2) ;
lineto (x+c/4) y ;
lineto (x+c/4) (y-c/4) ;
lineto x (y-c/2) ;
lineto (x-c/2) (y-c/2) ;;
etoile 100 100 20;;
这是终端:
即使图形已安装,如您在终端中所见。
请帮忙解决这个问题
在我看来你有
#load "graphics"
但你应该有#load "graphics.cma"
.
$ ocaml
OCaml version 4.07.0
# #load "graphics";;
Cannot find file graphics.
# #load "graphics.cma";;
#