caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Aaron Bohannon <bohannon@cis.upenn.edu>
To: Robert Roessler <roessler@rftp.com>
Cc: OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] linking errors involving cpp files
Date: Tue, 15 Dec 2009 08:50:33 -0500	[thread overview]
Message-ID: <c413fcb70912150550q6d103c39s3431850964ddda39@mail.gmail.com> (raw)
In-Reply-To: <BLU0-SMTP2107EC0D977E613FCE7F09C7880@phx.gbl>

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


  reply	other threads:[~2009-12-15 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-15  5:09 Aaron Bohannon
2009-12-15  6:59 ` [Caml-list] " Robert Roessler
2009-12-15 13:50   ` Aaron Bohannon [this message]
2009-12-15 13:59     ` Mark Shinwell
2009-12-15 20:47       ` Aaron Bohannon
2009-12-15 14:50     ` Jan Kybic
2009-12-15 15:04       ` Basile STARYNKEVITCH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c413fcb70912150550q6d103c39s3431850964ddda39@mail.gmail.com \
    --to=bohannon@cis.upenn.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=roessler@rftp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).