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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 614557F890 for ; Tue, 25 Mar 2014 16:04:02 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of utizoc@gmail.com) identity=pra; client-ip=209.85.215.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="utizoc@gmail.com"; x-sender="utizoc@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of utizoc@gmail.com designates 209.85.215.53 as permitted sender) identity=mailfrom; client-ip=209.85.215.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="utizoc@gmail.com"; x-sender="utizoc@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-la0-f53.google.com) identity=helo; client-ip=209.85.215.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="utizoc@gmail.com"; x-sender="postmaster@mail-la0-f53.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuEBAECaMVPRVdc1lGdsb2JhbABZg0FXrAWWaIESCBYOAQEBAQcLCwkSKoIlAQEBBEABGxILAQMMBgULDQ0hIgERAQUBChISBxKHUgEDEQ2gXIxfgw6WVwoZJwMKZIZOEQEFDI5iBxaEIgSYTYEyjxEYKYR2Iw X-IPAS-Result: AuEBAECaMVPRVdc1lGdsb2JhbABZg0FXrAWWaIESCBYOAQEBAQcLCwkSKoIlAQEBBEABGxILAQMMBgULDQ0hIgERAQUBChISBxKHUgEDEQ2gXIxfgw6WVwoZJwMKZIZOEQEFDI5iBxaEIgSYTYEyjxEYKYR2Iw X-IronPort-AV: E=Sophos;i="4.97,728,1389740400"; d="scan'208";a="64668355" Received: from mail-la0-f53.google.com ([209.85.215.53]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 25 Mar 2014 16:04:01 +0100 Received: by mail-la0-f53.google.com with SMTP id b8so462283lan.40 for ; Tue, 25 Mar 2014 08:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qb84/dY8tL+tvqCoHzo3F+smZbfytn2WhQIoLc1GW9s=; b=wuf4K9pGTRScxbhEpBq7yZflmXM8b0Rmu0Jg/cO0WOV37g1kunOJT3biAWB8DCXt43 ajSJ4NZIIcCabYh2nQnIPul0wNy3tWKFi/UonnWO3XVJj1+NgfdwmcMs5l1iblURDyLe Ibe10EC7URED7GTRGuTfmyFlscisXYrhd73JDt4Vx8LlBKpCE7hw6eai1G2smU/keLgq bZiUR0TDpsl2W69fK4UtLrbuHYDtYrOsNEy+w2rIhjUZmLn0KFAePI89+C4Ht7svV+4h JL9NNxI6VD5iAGQ5OoCV4W92Svfb8ZV3DdycjvF8i8qIAHVb1pLkaGiDaQShy8E8NfAy lvcg== MIME-Version: 1.0 X-Received: by 10.112.31.163 with SMTP id b3mr173246lbi.61.1395759841200; Tue, 25 Mar 2014 08:04:01 -0700 (PDT) Received: by 10.114.183.40 with HTTP; Tue, 25 Mar 2014 08:04:01 -0700 (PDT) In-Reply-To: References: Date: Tue, 25 Mar 2014 12:04:01 -0300 Message-ID: From: Bruno Deferrari To: dbenjamin@janestreet.com Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Static linking via Ctypes? On Tue, Mar 25, 2014 at 11:54 AM, wrote: > I'm using Ctypes to interface with a dynamic library, but in addition to the > interface provided the library I have some helper functions (written in C, > against the same library) that I'd also like to call via Ctypes. Is there any > way to achieve this via static linking or am I required to build another > shared object? > Static linking works. I was in this same situation yesterday, and adding the .o files that were generated from C sources to the linking step did the trick. If you are trying to link a .a file, you may have to pass the -force_load option to the linker to force it to include it, otherwise it may see that none of the symbols there are being referenced directly and decide to not include it (this happened to me when using clang in OSX). > -- > 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 -- BD