0
votes

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
The bottom of the tutorial seems to give much more compiler invocation than what you're using: >ocamlc -I +camlp4 -pp camlp4of.opt camlp4lib.cma pa_vector.ml camlp4 -parser pa_vector.cmo - Edgar Aroutiounian

1 Answers

-2
votes

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.