Unbound module Camlp4

323 Views Asked by At

I am aware of similar questions on this site but none of them have helped to solve my problem.

I am very new at OCaml and am using the following tutorial about using Camlp4 https://github.com/ocaml/camlp4/wiki/OCaml_code_generation_tutorial

However I get an error on the first line: open Camlp4.PreCast saying "Unbound module Camlp4"

There is a camlp4.exe file where I have downloaded OCaml so I assumed it was installed. I have tried this both on Windows 8 and Xubuntu

This is the input I am passing to the command line to compile the file: ocamlc -o test.exe test.ml where test.ml is the file that contains the line with the error

1

There are 1 best solutions below

3
On

You should know that camlp4 is deprecated, you should use ppx instead.

If you need to compile an old programs using camlp4, they should have instructions on how to build. Anyway it's very rare to use ocamlc directly, you should try ocamlbuild or at least use ocamlfind.