From: David Allsopp <dra-news@metastack.com>
To: caml-list <caml-list@inria.fr>
Subject: RE: [Caml-list] Using OCaml from C
Date: Tue, 10 Sep 2013 13:30:08 +0000 [thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9CCB9CF15@Remus.metastack.local> (raw)
In-Reply-To: <522F1A03.9020001@glondu.net>
Stéphane Glondu wrote:
> Le 10/09/2013 14:21, Tom Ridge a écrit :
> > /home/tr61/.opam/4.00.1/lib/core/libcore_stubs.a(unix_stubs.o): In
> > function `unix_clock_gettime':
> > unix_stubs.c:(.text+0x2776): undefined reference to `clock_gettime'
> >
> > I had -lrt after -lpthread, but the error was still reported; when I
> > moved -lrt to end of command line things seemed to work; why?
<snip>
> > My real question is: what command *should* I be using to compile my
> > example? Or is the above more-or-less expected?
>
> Your calls to cp, ar and your use of -custom look suspicious. But it is
> difficult to be more helpful without a concrete testcase.
They're exactly as in the manual and are correct for compiling with ocamlc for static linking with C code. The cp and ar calls are necessary to set-up the static library (which should use libcamlrun.a as a starting point) - see #19.8 (the example in question), #19.7.4, #19.7.5 and #19.1.3 in the manual.
David
next prev parent reply other threads:[~2013-09-10 13:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 12:21 Tom Ridge
2013-09-10 12:41 ` David Allsopp
2013-09-10 13:21 ` Gerd Stolpmann
2013-09-10 13:09 ` Stéphane Glondu
2013-09-10 13:30 ` David Allsopp [this message]
2013-09-10 13:59 ` Tom Ridge
2013-09-10 14:21 ` Stéphane Glondu
[not found] ` <CABooLwPmKWc0KAOZ2weuwAfBbXUUKhBa7rxJ+=LASVL-0KeBmA@mail.gmail.com>
2013-09-10 17:21 ` Fwd: " Tom Ridge
2013-09-10 17:27 ` Adrien Nader
2013-09-12 9:51 ` Stéphane Glondu
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=E51C5B015DBD1348A1D85763337FB6D9CCB9CF15@Remus.metastack.local \
--to=dra-news@metastack.com \
--cc=caml-list@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