2

I have a OCaml library installed. To prove that I have this:

$ ~/.opam/bin/opam install camlp4
[NOTE] Package camlp4 is already installed (current version is 4.02+system).

And this:

$ ls `ocamlc -where`/camlp4*
Camlp4.cmi     Camlp4Bin.cmx  Camlp4Parsers   Camlp4Top.cmi      camlp4fulllib.a     camlp4lib.a     camlp4o.cma    camlp4orf.cma   camlp4prof.cmx  camlp4rf.cma
Camlp4Bin.cmi  Camlp4Bin.o    Camlp4Printers  Camlp4Top.cmo      camlp4fulllib.cma   camlp4lib.cma   camlp4of.cma   camlp4prof.cmi  camlp4prof.o
Camlp4Bin.cmo  Camlp4Filters  Camlp4Top       Camlp4_config.cmi  camlp4fulllib.cmxa  camlp4lib.cmxa  camlp4oof.cma  camlp4prof.cmo  camlp4r.cma

But when I try this, it fails to recognise the file

$ ocamlfind query camlp4
ocamlfind: Package `camlp4' not found

How can I enable it?

My ~/.ocamlinit looks like this:

let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;
#use "topfind";;
neversaint
  • 60,904
  • 137
  • 310
  • 477
  • `~/.ocamlinit` is the initial file executed by the toplevel `ocaml` and has nothing to do with `ocamlfind`. – ChriS Jul 12 '15 at 09:37

1 Answers1

1

Chances are good that you forget to activate your opam enviromnment with

 eval $(opam config env) 

command. And you're trying to compile with your system compiler, i.e., a compiler installed by your system package manager

ivg
  • 34,431
  • 2
  • 35
  • 63