From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D681CBBAF for ; Tue, 15 Dec 2009 16:04:44 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An8FAKc0J0s+BBB0eWdsb2JhbACBS5cjglEBAQsLCAcUBLxphCsEgWI X-IronPort-AV: E=Sophos;i="4.47,400,1257116400"; d="scan'208";a="52151114" Received: from smtp-116-tuesday.nerim.net (HELO maiev.nerim.net) ([62.4.16.116]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Dec 2009 16:04:44 +0100 Received: from hector.lesours (ours.starynkevitch.net [213.41.244.95]) by maiev.nerim.net (Postfix) with ESMTP id 8A565B8E2A; Tue, 15 Dec 2009 16:04:43 +0100 (CET) Received: from glinka.lesours ([192.168.0.1]) by hector.lesours with esmtp (Exim 4.69) (envelope-from ) id 1NKYxB-0003Hf-As; Tue, 15 Dec 2009 16:04:45 +0100 Message-ID: <4B27A58C.5020003@starynkevitch.net> Date: Tue, 15 Dec 2009 16:04:44 +0100 From: Basile STARYNKEVITCH User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: kybic@fel.cvut.cz Cc: Aaron Bohannon , OCaml List Subject: Re: [Caml-list] linking errors involving cpp files References: <7a9cb3950912150650k5ef8d6a6uf125d035876cdc8d@mail.gmail.com> In-Reply-To: <7a9cb3950912150650k5ef8d6a6uf125d035876cdc8d@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; basile:01 basile:01 cpp:01 cpp:01 ocaml:01 ocaml:01 faiencerie:01 92340:01 reine:01 2009:98 wrote:01 wrote:01 upenn:01 naming:01 caml-list:01 Jan Kybic wrote: > On Tue, Dec 15, 2009 at 2:50 PM, Aaron Bohannon wrote: >> Thanks for the tip. This does resolve the missing caml symbols (even >> when naming the file with a cpp extension). However, my real program >> actually uses some C++ features. I think I could convert it to a real >> C program, but I assumed there would be some other way. >> > > What you can do is to create a thin C layer between your Ocaml and C++ code. > I am including a very simple code - an interface to the Cubpack > library in Ocaml. > In addition of all the other good answers, you could look at how some existing C++ open-source libraries interface to Ocaml. Both the Parma Polyhedra Library (PPL, under GPLv3 licence), at http://www.cs.unipr.it/ppl/ and the Low Level Virtual Machine library (LLVM, under a BSD-like licence) at http://llvm.org/ are free libraries, coded in C++, interfaced to Ocaml. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***