Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2002-10-17 (16:21)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] [camlp4] compiling against Pcaml module

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

>   ocamlc -o bar -I +camlp4 gramlib.cma
> 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 like this:

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

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: