caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [camlp4] compiling against Pcaml module
@ 2002-10-17 16:08 Stefano Zacchiroli
  2002-10-17 16:21 ` Daniel de Rauglaudre
  2002-10-17 16:22 ` Samuel Lacas
  0 siblings, 2 replies; 8+ messages in thread
From: Stefano Zacchiroli @ 2002-10-17 16:08 UTC (permalink / raw)
  To: Inria Ocaml Mailing List

I'm trying to play with ocaml sources abstract syntax tree, but I'm
unable to compile against Pcaml module.

As camlp4 reference manual report at the beginning of chapter 8:

  When linking an application using this library modules, you have to
  add the file gramlib.cma in the command line. For example, with the
  line:
          ocamlc -I +camlp4 gramlib.cma <the_files> 

This seems to work with modules from camlp4 library modules other that
Pcaml (try for example with Fstream or Stdpp).

As an example I've tried to build the following source file:

   (* bar.ml *)
   let ast =
     !Pcaml.parse_interf (Stream.of_channel (open_in "foo.mli"))
   in
     print_endline "foo"

with the following command:

  ocamlc -o bar -I +camlp4 gramlib.cma bar.ml

and I get:

  Error while linking ast_prova.cmo: Reference to undefined global `Pcaml'

I've also digged into <stdlib>/camlp4/gramlib.a with 'nm' and indeed I
found no symbols starting with "Pcaml" string.
Unfortunately the stdlib directory contains also no pcaml.cmo object ..

What I've to link additionally to gramlib.cma in order to use "Pcaml"
module?

BTW, is probably better also to correct the camlp4 manual with the
appropriate compile line, if I haven't missed something though.

TIA,
Cheers.

-- 
Stefano Zacchiroli - undergraduate student of CS @ Univ. Bologna, Italy
zack@cs.unibo.it | ICQ# 33538863 | http://www.cs.unibo.it/~zacchiro
"I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!" -- G.Romney
-------------------
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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-10-17 17:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-17 16:08 [Caml-list] [camlp4] compiling against Pcaml module Stefano Zacchiroli
2002-10-17 16:21 ` Daniel de Rauglaudre
2002-10-17 16:23   ` Daniel de Rauglaudre
2002-10-17 16:22 ` Samuel Lacas
2002-10-17 16:26   ` Daniel de Rauglaudre
2002-10-17 16:28     ` [Caml-list] a quick question on camlp4 Alexander V.Voinov
2002-10-17 16:55       ` Daniel de Rauglaudre
2002-10-17 17:07         ` Alexander V.Voinov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).