How to use syntax extension?

Hello, I am trying to run the first given example of the section “Using the PPX” of and.

I put the code in a file named running the following command,

ocamlfind ocamlc -package pgocaml

I get the following error:

Error: Uninterpreted extension ‘pgsql’

Am I missing something really trivial to make the syntax extension to work ?

I think the issue is the command you provided just includes the pgocaml library, but doesn’t run the ppx-rewriter.

The following command might be closer to be what you want:

ocamlfind ocamlc -package pgocaml -pp "ppxfind pgocaml_ppx" ./