From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p42C0jf8013426 for ; Mon, 2 May 2011 14:00:45 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEADCcvk1QRFuw/2dsb2JhbACmHHe/eIYABJ0c X-IronPort-AV: E=Sophos;i="4.64,302,1301868000"; d="scan'208";a="98483092" Received: from furbychan.cocan.org ([80.68.91.176]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 02 May 2011 14:00:40 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.72) (envelope-from ) id 1QGrnr-0006q4-Bj; Mon, 02 May 2011 13:00:39 +0100 Date: Mon, 2 May 2011 13:00:39 +0100 From: "Richard W.M. Jones" To: Paul Steckler Cc: caml-list@yquem.inria.fr Message-ID: <20110502120039.GA26250@annexia.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Subject: Re: [Caml-list] Mixed static/dynamic linking of libraries On Mon, May 02, 2011 at 04:49:03PM +1000, Paul Steckler wrote: > I want to statically link a library (libsqlite3.a) with my OCaml > application, but allow other > libraries to link dynamically. I'm building using ocamlfind on Linux. > I've tried various combinations > of -cclib -static and -cclib -Bdynamic, to no avail. If I use the arguments > > -cclib -static -cclib -lsqlite3 > > the linker appears to find libsqlite3.a, but the linker then tries to > statically link every other library > used by my application. That's so even if I follow the above by > -cclib -Bdynamic. > > Is there a way to mix static and dynamic libraries using ocamlfind? Have you tried naming the library explicitly, eg: -cclib /usr/lib/libsqlite3.a Rich. -- Richard Jones Red Hat