caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jianzhou Zhao <jianzhou@seas.upenn.edu>
To: caml-list@yquem.inria.fr
Subject: How to call OCaml from C++
Date: Mon, 22 Feb 2010 22:11:55 -0500	[thread overview]
Message-ID: <9dfe358d1002221911x27e70e1h7c1521b38184e372@mail.gmail.com> (raw)

Hi,

Does anyone call OCaml code from C++?
C can call OCaml with the OCaml foreign interfaces.
But when we call OCaml from C++, we need to consider ‘extern C'
stuff, like what we do when call C from C++, because the bridge
functions between C and OCaml are written in C.

However, those functions have not been prefixed with 'extern C',
and some functions, such as caml_alloc_dummy in libasmrun, have not
been exposed
in a head file. So it is hard to define a wrapper to let it work in C++.
When linking C++ and libasmrun, caml_alloc_dummy cannot
be found by the linker.

Does anyone happen to know how to solve this problem?

Thanks a lot.
Jianzhou


             reply	other threads:[~2010-02-23  3:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23  3:11 Jianzhou Zhao [this message]
2010-02-24  1:11 ` Michael Ekstrand

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=9dfe358d1002221911x27e70e1h7c1521b38184e372@mail.gmail.com \
    --to=jianzhou@seas.upenn.edu \
    --cc=caml-list@yquem.inria.fr \
    /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).