From: Eric Cooper <ecc@cmu.edu>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] calling OCaml from C on non-Mac platforms?
Date: Sun, 15 Nov 2009 09:55:52 -0500 [thread overview]
Message-ID: <20091115145552.GA14456@localhost> (raw)
In-Reply-To: <EB0C6A62-9DD3-48E6-BAE8-AB68A78699A5@johnnowak.com>
On Sun, Nov 15, 2009 at 08:27:49AM -0500, John Nowak wrote:
> I'm trying to call OCaml from C.
> [...]
> ocamlopt -output-obj hello.cmx -o hello.o
This is the main problem. You're clobbering the hello.o that OCaml
produced when compiling hello.ml into native code.
> Does anyone have a correct set of instructions for doing this on
> non-Mac platforms? Thanks.
This worked fine for me:
ocamlopt -output-obj -o temp.o hello.ml
gcc -o hello main.c temp.o -L/usr/lib/ocaml -lasmrun -lm -ldl
next prev parent reply other threads:[~2009-11-15 14:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-15 13:27 John Nowak
2009-11-15 14:55 ` Eric Cooper [this message]
2009-11-15 15:22 ` [Caml-list] " John Nowak
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=20091115145552.GA14456@localhost \
--to=ecc@cmu.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