English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
linking errors involving cpp files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-12-15 (15:04)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] linking errors involving cpp files
Jan Kybic wrote:
> On Tue, Dec 15, 2009 at 2:50 PM, Aaron Bohannon <bohannon@cis.upenn.edu> wrote:
>> Thanks for the tip.  This does resolve the missing caml symbols (even
>> when naming the file with a cpp extension).  However, my real program
>> actually uses some C++ features.  I think I could convert it to a real
>> C program, but I assumed there would be some other way.
> What you can do is to create a thin C layer between your Ocaml and C++ code.
> I am including a very simple code - an interface to the Cubpack
> library in Ocaml.

In addition of all the other good answers, you could look at how some existing C++ open-source libraries interface to Ocaml.

Both the Parma Polyhedra Library (PPL, under GPLv3 licence), at http://www.cs.unipr.it/ppl/ and the Low Level Virtual 
Machine library (LLVM, under a BSD-like licence) at http://llvm.org/ are free libraries, coded in C++, interfaced to Ocaml.


Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***