caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Tautrimas Pajarskas <tautrimas@tautrimas.lt>
To: guillaume.yziquel@citycable.ch
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Compiling C++ in OCaml using Swig to native code
Date: Mon, 22 Jun 2009 13:46:17 +0300	[thread overview]
Message-ID: <44e1544f0906220346w24b5a280kfdbc1b9e984ed5ef@mail.gmail.com> (raw)
In-Reply-To: <4A3E2B92.7020200@citycable.ch>

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1780 bytes --]

      reply	other threads:[~2009-06-22 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 11:36 Tautrimas Pajarskas
2009-06-21 12:46 ` [Caml-list] " Guillaume Yziquel
2009-06-22 10:46   ` Tautrimas Pajarskas [this message]

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=44e1544f0906220346w24b5a280kfdbc1b9e984ed5ef@mail.gmail.com \
    --to=tautrimas@tautrimas.lt \
    --cc=caml-list@yquem.inria.fr \
    --cc=guillaume.yziquel@citycable.ch \
    /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).