ocaml-ppx / ppx_tools

Tools for authors of ppx rewriters
MIT License
134 stars 39 forks source link

ocamlbuild: "Error: Uninterpreted extension 'expr'" #60

Closed apatil closed 7 years ago

apatil commented 7 years ago

I have a test file, test.ml:

(* test.ml *)
let x = [%expr 2 + 2]

When I try to build it with ocamlbuild, I see an error:

anand@localhost> ocamlbuild  -package ppx_tools -package ppx_tools.metaquot test.byte

+ /home/anand/.opam/4.04.0/bin/ocamlc.opt -c -I /home/anand/.opam/4.04.0/lib/ocaml/compiler-libs -I /home/anand/.opam/4.04.0/lib/ppx_tools -o test.cmo test.ml
File "test.ml", line 1, characters 10-14:
Error: Uninterpreted extension 'expr'.
Command exited with code 2.

I have ppx_tools 5.0, ocamlbuild 0.11.0 and ocaml 4.04.0. Thanks in advance!

hcarty commented 7 years ago

ocamlbuild does not use ocamlfind (-package flag) by default. Add the -use-ocamlfind flag to your ocamlbuild call and it should work.

apatil commented 7 years ago

That worked, thank you!