简体   繁体   English

ocaml中的未绑定模块图形

[英]Unbound module graphics in ocaml

I'm using ocaml toplevel and used: 我在顶层使用ocaml并使用:

#load "graphics.cma";;

The library got loaded, but when I'm trying: 库已加载,但是在尝试时:

open Graphics;;

I'm getting unbounded module Graphics error. 我收到无限模块图形错误。 I used #list to list all packages and "graphics" was there in the list. 我使用#list列出了所有软件包,并且列表中有“图形”。 I have seen all related answers but still don't get why I'm getting this error. 我已经看到所有相关的答案,但仍然不明白为什么我会收到此错误。

I don't know what symbol ** means in your code snippet, whether you tried to use some sort of markup, or not, but this symbols shouldn't be there: 我不知道符号**在您的代码段中是什么意思,是否尝试使用某种标记,但是这些符号不应存在:

# #load "graphics.cma";;
# open Graphics;;
# open_graph "";;
- : unit = ()
# 

Make sure that you literally input this directive ( # -including): #load "graphics.cma";; 确保您确实输入了该指令( # -包括): # #load "graphics.cma";;

If this still doesn't work, you can try #require "graphics";; 如果仍然#require "graphics";; ,可以尝试#require "graphics";; . This is, by the way, a preferred way to load libraries and packages in modern OCaml. 顺便说一下,这是在现代OCaml中加载库和包的首选方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM