1

I'm trying to load OCaml's default graphics module, but OCaml can't seem to load it or any other module. Here's what I'm trying:

> ocaml
    OCaml version 4.02.1

# load "graphics.cma";;
Error: Unbound value load

The problem persists no matter what module I try to load, so I believe that the problem is with the ocaml installation rather than with the module. I've tried reinstalling OCaml, but that hasn't helped either. I'm using OS X, and using homebrew to install ocaml. I found this link, and followed its instructions, but modules still won't load. Does anyone know what could be causing this problem?

2 Answers 2

3

You need to type #load, not just load.

Note that the OCaml prompt is also #. So it's confusing.

$ ocaml
        OCaml version 4.02.1

# load "unix.cma";;
Error: Unbound value load
# #load "unix.cma";;
# 
Sign up to request clarification or add additional context in comments.

Comments

0

Current state of the art if I dare say is

  • using opam to install packages,
  • findlib for using them in the toplevel,
  • and ocamlfind for the compilation.

If your project is bigger you would use ocamlbuild (currently comes with the compiler) or others to build it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.