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 (13:50)
From: Aaron Bohannon <bohannon@c...>
Subject: Re: [Caml-list] linking errors involving cpp files
On Tue, Dec 15, 2009 at 1:59 AM, Robert Roessler <roessler@rftp.com> wrote:
> Aaron Bohannon wrote:
>> How do I link C++ code with OCaml?

> You might try (when mixing C++ and OCaml) wrapping the whole thing in an
> 'extern "C" {...}' block (*including* the #includes and the entire main
> function).

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.

 - Aaron