From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=AWL,HTML_10_20,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 2B414BBAF for ; Thu, 12 Jun 2008 18:44:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQBADHvUEjRVcird2dsb2JhbACCPDeOZkMBDAMEBAkRA5tk X-IronPort-AV: E=Sophos;i="4.27,631,1204498800"; d="scan'208";a="13690928" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Jun 2008 18:44:46 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m5CGiffB026354 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 12 Jun 2008 18:44:45 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQBADHvUEjRVcird2dsb2JhbACCPDeOZkMBDAMEBAkRA5tk X-IronPort-AV: E=Sophos;i="4.27,631,1204498800"; d="scan'208";a="13690926" Received: from wf-out-1314.google.com ([209.85.200.171]) by mail1-smtp-roc.national.inria.fr with ESMTP; 12 Jun 2008 18:44:40 +0200 Received: by wf-out-1314.google.com with SMTP id 25so4196150wfa.0 for ; Thu, 12 Jun 2008 09:44:39 -0700 (PDT) Received: by 10.142.84.3 with SMTP id h3mr604697wfb.309.1213289079590; Thu, 12 Jun 2008 09:44:39 -0700 (PDT) Received: by 10.143.165.3 with HTTP; Thu, 12 Jun 2008 09:44:39 -0700 (PDT) Message-ID: <28fa90930806120944p4cf312e0w88d74c12251ed046@mail.gmail.com> Date: Thu, 12 Jun 2008 09:44:39 -0700 From: "Luca de Alfaro" To: "Inria Ocaml Mailing List" Subject: How to compile using sexplib? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_13800_14850192.1213289079586" X-Miltered: at concorde with ID 48515279.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; serialize:01 ocamlfind:01 ocamlc:01 -package:01 hashtbl:01 bounded:01 camlp:01 -pp:01 camlp:01 foo:01 sexp:01 -pp:01 syntax:01 preprocessed:01 preprocess:01 ------=_Part_13800_14850192.1213289079586 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 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 ------=_Part_13800_14850192.1213289079586 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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

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
------=_Part_13800_14850192.1213289079586--