Ocaml Unbound Graphics Module

后端 未结 2 630
闹比i
闹比i 2020-12-01 23:18

Running

open Graphics;;

in ocaml returns an error, saying it is an unbound module. Running it in terminal (ocaml) returns the same thing.

2条回答
  •  我在风中等你
    2020-12-02 00:06

    Graphics module is not ready by default. You need to load it manually. In toplevel:

    $ ocaml
           OCaml version blahblah
    # #load "graphics.cma";;
    # open Graphics;;
    

    or you can specify it at the command line:

    $ ocaml graphics.cma
           OCaml version blahblah
    # open Graphics;;
    

    I do not know about Fedora but if the above fails, graphics is not really installed in your environment.

提交回复
热议问题