deep19
deep19

Reputation: 91

Unbound module graphics in ocaml

I'm using ocaml toplevel and used:

#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. I have seen all related answers but still don't get why I'm getting this error.

Upvotes: 0

Views: 1494

Answers (1)

ivg
ivg

Reputation: 35210

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";;

If this still doesn't work, you can try #require "graphics";;. This is, by the way, a preferred way to load libraries and packages in modern OCaml.

Upvotes: 0

Related Questions