OCaml Forge

Caml Foreign Home

From Caml Foreign dynamic interface to C/C++ Wiki

Jump to: navigation, search

Caml Foreign is a Caml library to access C and C++ functions without writing C wrapping code. Instead, you write OCaml wrapping code. There is some functionality to cope with C++ classes : dynamic casting, constructors, destructors, methods.

At the moment it is Linux-only, gcc-only, and experimental. It is mostly undocumented.

Get the code using darcs :

 darcs get http://forge.ocamlcore.org/anonscm/darcs/caml-foreign/caml-foreign

You can send patches using

darcs send
# (sends to caml-foreign-devel@lists.forge.ocamlcore.org by default)

Build dependences:

  • g++
  • libffi-dev
  • ocamlfind (for installation)

Configure, build, test and install using the Oasis-generated build system:

ocaml setup.ml -configure
ocaml setup.ml -build
ocaml setup.ml -test
ocaml setup.ml -install

Caml-foreign is based on libffi.


Personal tools