Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] Calling C++ from OCaml

3 views
Skip to first unread message

Jean Yang

unread,
Feb 15, 2010, 11:32:48 AM2/15/10
to caml...@yquem.inria.fr
Hello,

I've been trying to call C++ from OCaml by using OCaml's external C
interface to call C functions that call the mangled-name version of the C++
functions. I've been running into trouble because I'm not sure how to
specify the C++ object files to link against with ocamlc. (I'm not sure how
to do it using ocaml-make.) Can anyone help?

Also, is this the best way to call from OCaml to C++?

Thanks,
Jean

--
Jean Yang
http://people.csail.mit.edu/jeanyang
Save us! Think before you print.

Roberto Bagnara

unread,
Feb 15, 2010, 11:46:06 AM2/15/10
to Jean Yang, caml...@yquem.inria.fr
On 02/15/10 17:32, Jean Yang wrote:
> I've been trying to call C++ from OCaml by using OCaml's external C
> interface to call C functions that call the mangled-name version of the
> C++ functions. I've been running into trouble because I'm not sure how
> to specify the C++ object files to link against with ocamlc. (I'm not
> sure how to do it using ocaml-make.) Can anyone help?
>
> Also, is this the best way to call from OCaml to C++?

I am not sure what is the best way to call C++ code from OCaml.
However, we successfully interfaced the Parma Polyhedra Library
core, which is written in C++, to OCaml. You can fetch a source
distribution from http://www.cs.unipr.it/ppl/ and look into the
interfaces/OCaml directory.
Hope it helps,

Roberto

--
Prof. Roberto Bagnara
Applied Formal Methods Laboratory
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bag...@cs.unipr.it

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

0 new messages