From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p6UAaUwH017400 for ; Sat, 30 Jul 2011 12:36:30 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBAEfeM07RVaE2kGdsb2JhbAA0AQEBAQIBFAIqCAEfHQEDAQwHBQs1EhQSAhIBBQEkBxcnp0MIFAEBAQEJCQ0HFAQhiHwCow8KjC+CVIQzO4htAgMGhjwEh1SLJ4Ytgz6CYTyDXw X-IronPort-AV: E=Sophos;i="4.67,291,1309730400"; d="scan'208";a="114525943" Received: from mail-fx0-f54.google.com ([209.85.161.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jul 2011 12:36:14 +0200 Received: by fxe4 with SMTP id 4so5945544fxe.27 for ; Sat, 30 Jul 2011 03:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=1OMqLd75Q2teHWsV7g6wDfQWbzzO+eSojWzvZgph9sI=; b=KR1FsuvLgyv1PBIfn1t+4gRxDXMRUBsX7BMamaaTLoxvvPL7U6XG088tpuKEnp3AWb x8XOkYliFSiUPeAdtJtF8bhc6udQklDOEnI7sE44uwLsdCvbg9WV44zISiyVsQrd7bHq 7pn2b1NCrMkpXJDkiEpDM4kbP01VK2+1nCncc= Received: by 10.223.100.89 with SMTP id x25mr3296094fan.81.1312022173655; Sat, 30 Jul 2011 03:36:13 -0700 (PDT) Received: from lemon.local.tld (227-28-132-95.pool.ukrtel.net [95.132.28.227]) by mx.google.com with ESMTPS id e10sm1606750fak.42.2011.07.30.03.36.11 (version=SSLv3 cipher=OTHER); Sat, 30 Jul 2011 03:36:12 -0700 (PDT) Date: Sat, 30 Jul 2011 13:35:18 +0300 From: ygrek To: ben mailist Cc: caml-list@inria.fr Message-Id: <20110730133518.798c6a30.ygrekheretix@gmail.com> In-Reply-To: References: X-Mailer: Sylpheed 3.0.2 (GTK+ 2.24.4; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] creating a standalone labltk program On Thu, 28 Jul 2011 14:43:58 +0200 ben mailist wrote: > I try to staticall link all necessary libraries to create a standalone > labltk application. So that it is no longer necessary to install the tcl/tk > runtime on the target machine. > [...] > $ ocamlopt -o lb -linkall -I +labltk labltk.cmxa listbox01.ml -linkall links in all ocaml modules, it has nothing to do with linking of external libraries. In order to link everything statically you need to ask C linker to do so - the simplest way is to use `-ccopt -static` but that means linking in libc which is not good usually. More involved and correct way is to wrap all external libraries with `-Wl,-Bstatic -lxxx -Wl,-Bdynamic` on command-line. Note that using `ocamlopt -ccopt -Wl,-Bstatic -ccopt -Wl,-Bdynamic` (to wrap all libs at once) will not usually work as ocamlopt reorders `-ccopt` at will :( Use `-verbose` to check what is being passed to gcc. -- ygrek http://ygrek.org.ua