billybobsteve
billybobsteve

Reputation: 33

OCaml: unbound value load when trying to load module

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?

Upvotes: 1

Views: 2897

Answers (2)

Str.
Str.

Reputation: 1439

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.

Upvotes: 0

Jeffrey Scofield
Jeffrey Scofield

Reputation: 66823

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

Upvotes: 3

Related Questions