caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: Luca de Alfaro <luca@dealfaro.org>
Cc: Inria Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] How to compile using sexplib?
Date: Thu, 12 Jun 2008 19:28:07 +0200	[thread overview]
Message-ID: <1213291687.10641.25.camel@flake.lan.gerd-stolpmann.de> (raw)
In-Reply-To: <28fa90930806120944p4cf312e0w88d74c12251ed046@mail.gmail.com>


Am Donnerstag, den 12.06.2008, 09:44 -0700 schrieb Luca de Alfaro:
> I am trying to use sexplib to serialize some data structures, as many
> of you advised, and I am somewhat stuck trying to compile. 
> This is what I get:
> 
> ocamlfind ocamlc -package
> unix,str,vec,mapmin,hashtbl_bounded,fileinfo,intvmap,extlib,mysql,sexplib -I ../../batch/analysis -I +camlp4 -pp camlp4orf -g -c online_db.ml
> File "online_db.ml", line 44, characters 22-26:
> Parse error: [semi] expected after [str_item] (in [implem])
> Preprocessor error

I would try

ocamlfind ocamlc -package sexplib,... -syntax camlp4o -I ... -c
online_db.ml

ocamlfind includes some mechanics to drive camlp4, and I am pretty sure
sexplib configures that.

Gerd

> 
> where my line 44 is simply: 
> 
> type foo_t = int list with sexp
> 
> I have the impression that the problem is in how I compile.
> Specifically, if I do not use the "-pp camlp4orf" part, I get a
> "syntax error", as the file is not getting preprocessed. 
> If I use the above -pp line, I get the error I reported.  I am not
> sure what is the proper way to preprocess the file, and unfortunately,
> sexplib does not explain how to compile code against it. 
> I am sure this is obvious for everybody, but it is the first time I
> use camlp4, so some help would be appreciated. 
> 
> All the best, 
> 
> Luca
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------



  reply	other threads:[~2008-06-12 17:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 16:44 Luca de Alfaro
2008-06-12 17:28 ` Gerd Stolpmann [this message]
2008-06-12 18:42   ` [Caml-list] " Markus Mottl
2008-06-12 19:23     ` Sylvain Le Gall
2008-06-12 22:02       ` [Caml-list] " Ian Pye
2008-06-12 22:31         ` Sylvain Le Gall
2008-06-12 19:17   ` [Caml-list] " Markus Mottl

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=1213291687.10641.25.camel@flake.lan.gerd-stolpmann.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=luca@dealfaro.org \
    /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).