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=2.8 required=5.0 tests=DNS_FROM_RFC_POST, HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 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 902B8BBAF for ; Mon, 22 Jun 2009 12:46:37 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUDAD/+PkrRVdzZmGdsb2JhbACCJDCVTT8BAQEBAQgJDAcTplaBFIwmAQMCBIQGBYct X-IronPort-AV: E=Sophos;i="4.42,267,1243807200"; d="scan'208";a="31700018" Received: from mail-fx0-f217.google.com ([209.85.220.217]) by mail1-smtp-roc.national.inria.fr with ESMTP; 22 Jun 2009 12:46:37 +0200 Received: by fxm17 with SMTP id 17so3147483fxm.27 for ; Mon, 22 Jun 2009 03:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=9ZE/7spRV5tqxLs5Ap8K4s9GKn/1X0G/JuBHQuPyles=; b=GiZr+rvEpbpzdA+ipmi6WABFwAcbRLSwZrHNparDYrVvrbG2+5Q6Pf0x+miQSe37ad qM1qJ63W8rTax74OxZjfpOB9/pmkeDGx8fHeOZPAe5wYoR8JulOQfTySvrnOP12M307e qUrzfYU73JZyrNKRu5Mz9QYVent2/pouasz4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=uQvJtyV2EgHoQ5buYZy10tWjrljNO17RkSdKtiMm8QQ/MohqyietQ608NBz/JnWpHZ mNzvj3UkcGdQuKaa/1jmRuL9I9olIsfkNac6WbCWkjt8xJwoJTUoW0hZNFR/vNDzsKBR OLxn/LsJKLaVbxkm+Kj7WbOB30igEUYmodeCw= MIME-Version: 1.0 Sender: tautrimui@gmail.com Received: by 10.86.98.7 with SMTP id v7mr6471130fgb.58.1245667597134; Mon, 22 Jun 2009 03:46:37 -0700 (PDT) In-Reply-To: <4A3E2B92.7020200@citycable.ch> References: <44e1544f0906090436l3eed359dq3740b5129c2cd6ef@mail.gmail.com> <4A3E2B92.7020200@citycable.ch> From: Tautrimas Pajarskas Date: Mon, 22 Jun 2009 13:46:17 +0300 X-Google-Sender-Auth: c03c2e8ce4babda2 Message-ID: <44e1544f0906220346w24b5a280kfdbc1b9e984ed5ef@mail.gmail.com> Subject: Re: [Caml-list] Compiling C++ in OCaml using Swig to native code To: guillaume.yziquel@citycable.ch Cc: caml-list@yquem.inria.fr Content-Type: multipart/alternative; boundary=000e0cd24d7ea2ae17046ced960b X-Spam: no; 0.00; ocaml:01 swig:01 guillaume:01 guillaume:01 ocaml:01 swig:01 bytecode:01 ocamlopt:01 bytecode:01 makefile:01 byte:01 cpp:01 ocamlopt:01 makefile:01 byte:01 X-Attachments: cset="UTF-8" cset="UTF-8" --000e0cd24d7ea2ae17046ced960b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Sun, Jun 21, 2009 at 3:46 PM, Guillaume Yziquel < guillaume.yziquel@citycable.ch> wrote: > > Hello. > > I'm trying to access C++ code from OCaml using Swig. I successfully >> compiled C++ code as a shared library through swig's C++ wrapper but >> only in bytecode. Now, if I try the procedures listed in >> >> http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.php#ref_cplusplus >> for ocamlopt, I get an error: >> > > I'm sorry I can't help you, but you can help me: I'm also interested in > binding C++ code to OCaml. Could I have a look at what you did so that I can > have some guidance as to how to bind C++ code? I'd be perfectly happy with > bytecode... You can have a look at the Makefile (http://pastebin.com/f5f55f789). If you follow caller.byte (which is made from a simple ocaml source file for calling c++ function from compiled library called md5wrapper.cma) you will have all the instructions required to compile c++ library md5wrapper.cpp for ocaml. For me, it was a good example of how to use multiple files with bytecode. Native code still doesn't work and I still seek help. If there is something unclear, just ask. -- Tautrimas Pajarskas --000e0cd24d7ea2ae17046ced960b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sun, Jun 21, 2009 at 3:46 PM, Guillaume Yziquel &= lt;guillaume.yziquel@city= cable.ch> wrote:

Hello.

I'm trying to access C++ code from OCaml using Swig. I successfully
compiled C++ code as a shared library through swig's C++ wrapper but only in bytecode. Now, if I try the procedures listed in
http://www.linux-nantes.org/~fmonnier/OCa= ml/ocaml-wrapping-c.php#ref_cplusplus
for ocamlopt, I get an error:

I'm sorry I can't help you, but you can help me: I'm also inter= ested in binding C++ code to OCaml. Could I have a look at what you did so = that I can have some guidance as to how to bind C++ code? I'd be perfec= tly happy with bytecode...
=C2=A0=C2=A0
You can have a look at the Makefile (http://pastebin.com/f5f55f789). I= f you follow caller.byte (which is made from a simple ocaml source file for= calling c++ function from compiled library called md5wrapper.cma) you will= have all the instructions required to compile c++ library md5wrapper.cpp f= or ocaml. For me, it was a good example of how to use multiple files with b= ytecode. Native code still doesn't work and I still seek help.
If there is something unclear, just ask.

--
Tautrimas Paj= arskas

--000e0cd24d7ea2ae17046ced960b--