Version française
Home     About     Download     Resources     Contact us    
Browse thread
building executables with camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] building executables with camlp4
On 6/13/07, Jeremy Yallop <jeremy.yallop@ed.ac.uk> wrote:
> Nicolas Pouillard wrote:
> >> But this doesn't:
> >>
> >>       $ ocamlc -g -linkall -I /usr/local/ocaml/lib/ocaml/camlp4  \
> >>         -o minimal \
> >>         camlp4lib.cma \
> >>         unix.cma \
> >>         Camlp4Parsers/Camlp4OCamlRevisedParser.cmo \
> >>         Camlp4Parsers/Camlp4OCamlParser.cmo \
> >>         Camlp4Printers/Camlp4OCamlPrinter.cmo \
> >>         Camlp4Bin.cmo \
> >>         minimal.cmo
> >>       $ ./minimal input.ml
> >>       File "input.ml", line 1, characters 35-36:
> >>       Parse error: ident_of_ctyp: this type is not an identifier
> >
> > Try to put Camlp4Bin before minimal, since it's the main so the init
> > section of this module is the starting point.
>
> Sorry, I don't follow.  Camlp4Bin is before minimal above, right?  If I
> reverse the order of Camlp4Bin.cmo and minimal.cmo I get Not_found
> errors again when I run the program.
>

Hum, sorry for my very confusing previous answer. I thought "Camlp4Bin
*after* minimal". But you've tried that.

After thinking a little more, I can explain what's happening there is
two modes to get into Camlp4 pipeline. The first one is through
registration and the second one is through dyn-linking of cmo files on
the command line.

Here your Minimal module is neither on the command line nor registered.

To register it make a functor around your grammar extension and call
Camlp4.Register.OCamlSyntaxExtension.

-- 
Nicolas Pouillard