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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 4BE2ABBAF for ; Thu, 22 Jan 2009 16:21:42 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtUJACMeeEnD2MUqXWdsb2JhbACTciMhtzyFcw X-IronPort-AV: E=Sophos;i="4.37,307,1231110000"; d="scan'208";a="34132077" Received: from bluelynx4.ukhost4u.com ([195.216.197.42]) by mail4-smtp-sop.national.inria.fr with ESMTP; 22 Jan 2009 16:21:41 +0100 Received: from [94.194.70.78] (helo=feast.lan) by bluelynx4.ukhost4u.com with esmtpa (Exim 4.69) (envelope-from ) id 1LQ1NC-0007ja-Jz for caml-list@yquem.inria.fr; Thu, 22 Jan 2009 15:21:39 +0000 Message-Id: <04CCDF06-0F4F-4F82-9F87-9DD9BD9017C6@coherentgraphics.co.uk> From: John Whitington To: caml-list@yquem.inria.fr In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Building with OCamlMkLib Date: Thu, 22 Jan 2009 15:21:20 +0000 References: X-Mailer: Apple Mail (2.930.3) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluelynx4.ukhost4u.com X-AntiAbuse: Original Domain - yquem.inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Spam: no; 0.00; ocamlmklib:01 ocamlmklib:01 ocaml:01 ocamlc:01 mli:01 ocamlopt:01 ocamlc:01 ocamlopt:01 -output-obj:01 cmx:01 usr:01 lib:01 ocaml:01 libasmrun:01 wrote:01 Hi. On 20 Jan 2009, at 17:03, John Whitington wrote: > I'm building a Plain C interface to our PDF libraries, but am stuck. > The idea is to build a library with Ocamlmklib containing the C > wrapper around the ocaml code. Thanks to those who helped me here - I finally settled on a modified version of what's given in 18.8 in the manual. Here are the new files: http://www.coherentpdf.com/solution.tar.bz2 And here's what we ended up with... ocamlc cpdflibc.mli ocamlopt cpdflibc.ml ocamlc cpdflibwrapper.c ocamlopt -output-obj -o cpdflibc.o cpdflibc.cmx cp /usr/local/lib/ocaml/libasmrun.a cpdflib.a ar r cpdflib.a cpdflibc.o cpdflibwrapper.o ...producing the final cpdflib.a with which we can do... cc -o test test.c cpdflib.a ...to use the library. With Thanks, -- John Whitington Coherent Graphics Ltd http://www.coherentpdf.com/