From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 3FFCF820A1 for ; Tue, 10 Sep 2013 16:00:21 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of tom.j.ridge@googlemail.com) identity=pra; client-ip=209.85.160.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of tom.j.ridge@googlemail.com designates 209.85.160.46 as permitted sender) identity=mailfrom; client-ip=209.85.160.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="tom.j.ridge@googlemail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pb0-f46.google.com) identity=helo; client-ip=209.85.160.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="tom.j.ridge@googlemail.com"; x-sender="postmaster@mail-pb0-f46.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiwCAMMkL1LRVaAujWdsb2JhbABbgz9Rr2uSUIEbCBYOAQEBAQcLCwkSBiSCJQEBBUABASwMDwEKCw0NISISAQUBChIGExIIh1UBAw8MokWLDIRKAQWEMgoZJwMKiSkGjip+hFeXeYEvjlMYKYFhgmg7 X-IPAS-Result: AiwCAMMkL1LRVaAujWdsb2JhbABbgz9Rr2uSUIEbCBYOAQEBAQcLCwkSBiSCJQEBBUABASwMDwEKCw0NISISAQUBChIGExIIh1UBAw8MokWLDIRKAQWEMgoZJwMKiSkGjip+hFeXeYEvjlMYKYFhgmg7 X-IronPort-AV: E=Sophos;i="4.90,878,1371074400"; d="scan'208";a="26366854" Received: from mail-pb0-f46.google.com ([209.85.160.46]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Sep 2013 16:00:20 +0200 Received: by mail-pb0-f46.google.com with SMTP id rq2so7595043pbb.19 for ; Tue, 10 Sep 2013 07:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=dXWqH1n+gqouik7IC8l4YkK7yPZi0IkLDRnHWE4I6XA=; b=DpLB6kIuMj6avv7QCi4gBjvfBQ3t4pWKg6uKM6nPFQpHjnfefIX7HLw4upO5vKb1Ys 1RI2knTVGEpjiwghsFeC9B9RKQvbh1XmsU0sfYfq5R6SZTLPifjwF3H8TwqYSv+reaB+ SOfhNyaeNXBKZXn1DdNSjfMX2Ky83FVwDa+6w+1Tdmu0QxKVZaruxLOpMzrwNBFLWMxl bTZR68SfEiGD4o2gv1xwY9i+PNwVj9St4oAO5ehilcfntMKvNgR1nIXe1vNWZQqCs3B0 OLWhnIcqdxN5yvzXWp0Gd7bf8UNtzUVRJ5/2pCjgpWd08QT1Kpepkusab1tq+eLJd6Tj n+VA== X-Received: by 10.66.191.5 with SMTP id gu5mr9781807pac.126.1378821617894; Tue, 10 Sep 2013 07:00:17 -0700 (PDT) MIME-Version: 1.0 Sender: tom.j.ridge@googlemail.com Received: by 10.70.79.136 with HTTP; Tue, 10 Sep 2013 06:59:57 -0700 (PDT) In-Reply-To: References: <522F1A03.9020001@glondu.net> From: Tom Ridge Date: Tue, 10 Sep 2013 14:59:57 +0100 X-Google-Sender-Auth: S_yGwYw3F76n6BApoJm9EPpFXVY Message-ID: To: caml-list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Using OCaml from C 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 wrote: > St=E9phane Glondu wrote: >> Le 10/09/2013 14:21, Tom Ridge a =E9crit : >> > /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? > > > >> > 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 ocaml= c 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 m= anual. > > > 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