caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stefano Zacchiroli <zack@cs.unibo.it>
To: Inria Ocaml Mailing List <caml-list@inria.fr>
Subject: [Caml-list] [camlp4] compiling against Pcaml module
Date: Thu, 17 Oct 2002 18:08:37 +0200	[thread overview]
Message-ID: <20021017160837.GA29662@cs.unibo.it> (raw)

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


             reply	other threads:[~2002-10-17 16:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-17 16:08 Stefano Zacchiroli [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021017160837.GA29662@cs.unibo.it \
    --to=zack@cs.unibo.it \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).