caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Tom Ridge <tom.j.ridge+caml@googlemail.com>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Using OCaml from C
Date: Tue, 10 Sep 2013 14:59:57 +0100	[thread overview]
Message-ID: <CABooLwMVb+fAabt6k6Sx+6B4tVKuFfmwF+AJ5FYSXHjwG=D15w@mail.gmail.com> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9CCB9CF15@Remus.metastack.local>

Dear List,

Thank you for all the replies. At least I feel that I am not doing
something *too* stupid. I will try to follow Gerd's suggestion and
inspect the final cc command from "ocamlfind ocamlc", and
cut-and-paste the relevant parts into the makefile.

Thanks

On 10 September 2013 14:30, David Allsopp <dra-news@metastack.com> wrote:
> 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
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

  reply	other threads:[~2013-09-10 14:00 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
2013-09-10 13:59     ` Tom Ridge [this message]
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='CABooLwMVb+fAabt6k6Sx+6B4tVKuFfmwF+AJ5FYSXHjwG=D15w@mail.gmail.com' \
    --to=tom.j.ridge+caml@googlemail.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;
as well as URLs for NNTP newsgroup(s).