Version française
Home     About     Download     Resources     Contact us    
Browse thread
Compiling C++ in OCaml using Swig to native code
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Tautrimas Pajarskas <tautrimas@t...>
Subject: Re: [Caml-list] Compiling C++ in OCaml using Swig to native code
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