From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 924C5BC57 for ; Thu, 15 Apr 2010 08:59:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkEAJpVxktKfVI0kWdsb2JhbACPcYFWihIIFQEBAQEJCQwHDyStI4FxhhEuiE0BAQMFhQkEgyQ X-IronPort-AV: E=Sophos;i="4.52,211,1270418400"; d="scan'208";a="60733815" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail4-smtp-sop.national.inria.fr with ESMTP; 15 Apr 2010 08:59:35 +0200 Received: by wwb39 with SMTP id 39so632518wwb.39 for ; Wed, 14 Apr 2010 23:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nvi61FwLo7GacUw9ctRrfy7iQ/SddKAZdwtZ1jCS3wM=; b=XXmrPpydyhsk5reueCBI5zaORv54HAY4+loZowD+0B9/kD2e3uVhQFfjAIWaxBHMki jgd6pZhnVTOUde8B5p4Xy6VvThYhkk+VilGOpfOQBvF2pLz04eYYouYHUEJIxo3UQJzD gJa82swxhZ+ddunZypPNETse8HGIPShs/pYw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WZBnW7OX7kO9b4FW+jY9TDUp3nLOzSk6RtUi3LyvH0jkzrjTctOViqWFjk1GycBcU0 QgHVz9ay058e82kXfhXU9ki7IxRpU50j6OG8c+gG5fGFBuEfCVco4pKAylCK+jRtt5u7 /dpM2RSXWdyB5sPY0M5Pm5hW4HrJKkPK7Gdgo= MIME-Version: 1.0 Received: by 10.216.89.143 with HTTP; Wed, 14 Apr 2010 23:59:34 -0700 (PDT) In-Reply-To: References: Date: Thu, 15 Apr 2010 10:59:34 +0400 Received: by 10.216.155.196 with SMTP id j46mr6106561wek.1.1271314774669; Wed, 14 Apr 2010 23:59:34 -0700 (PDT) Message-ID: Subject: Re: [Caml-list] Statically linked win32 libcamlrun.lib? From: Dmitry Bely To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; statically:01 libcamlrun:01 lib:01 statically:01 libcamlrun:01 lib:01 nodefaultlib:01 runtime:01 makefile:01 makefile:01 sscanf:01 ocaml:01 runtime:01 flags:01 2019:98 On Thu, Apr 15, 2010 at 3:39 AM, Lally Singh wrote: > =A0Is it possible to statically link libcamlrun.lib, so it'll work with > libcmtd.lib instead of msvcrt.dll? =A0I've tried: > > FLEXLINK=3Dflexlink -merge-manifest -link /nodefaultlib:msvcrt.lib -link > libcmtd.lib Please don't use "brute force" methods. If you need statically linked MSVC runtime, just replace /MD with /MT (or /MTd) in config/Makefile. > in config/Makefile, and it all builds.=A0However, I still get: > > libcamlrun.lib(sys.obj) : error LNK2019: unresolved external symbol > __imp__system referenced in function _caml_sys_system_command > libcamlrun.lib(floats.obj) : error LNK2019: unresolved external symbol > __imp__frexp referenced in function _caml_frexp_float > libcamlrun.lib(floats.obj) : error LNK2019: unresolved external symbol > __imp__modf referenced in function _caml_modf_float > libcamlrun.lib(startup.obj) : error LNK2019: unresolved external > symbol __imp__sscanf referenced in function _scanmult > libcamlrun.lib(startup.obj) : error LNK2019: unresolved external > symbol __imp___beginthread referenced in function _caml_main > > Any thoughts? Ocaml expects C runtime functions exported from a DLL (they have __implib prefix). No surprise - MSVC runtime is not a link time choice and requires correct compile time flags. > Sadly I have to do it this way -- we're linking a -output-obj'd .obj > into our DLL (which must be statically linked to the runtime) and then > linking libcamlrun.lib to that -- or at least hoping to. > > Thanks in advance for any help! - Dmitry Bely