Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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