Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] [camlp4] compiling against Pcaml module
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] [camlp4] compiling against Pcaml module
Hi,

On Thu, Oct 17, 2002 at 06:08:37PM +0200, Stefano Zacchiroli wrote:

>   ocamlc -o bar -I +camlp4 gramlib.cma bar.ml
> and I get:
>   Error while linking ast_prova.cmo: Reference to undefined global `Pcaml'

The gramlib.cma of Camlp4 is just if you use Camlp4 to make grammars
of your language, i.e. an alternative to ocamlyacc.

If you write a program using the module Pcaml, i.e. if it is about the
specific grammar of OCaml, you need to use the library camlp4.cma. But!
You need also to specify which syntax you want. For the normal syntax,
add "pa_o.cmo", for the revised syntax "pa_r.cmo", and for the Scheme
syntax "pa_scheme.cmo".

If your file "foo.mli" of your example is written in normal syntax,
just compile your bar.ml like this:

   ocamlc -o bar -I +camlp4 camlp4.cma pa_r.cmo bar.ml

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners