From unknown Mon Jun 23 13:15:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#45738: cannot link a static library into a dll Resent-From: Ozkan Sezer Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Sat, 09 Jan 2021 10:30:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45738 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 45738@debbugs.gnu.org X-Debbugs-Original-To: bug-libtool@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161018814726824 (code B ref -1); Sat, 09 Jan 2021 10:30:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jan 2021 10:29:07 +0000 Received: from localhost ([127.0.0.1]:51248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyBUY-0006ya-Qk for submit@debbugs.gnu.org; Sat, 09 Jan 2021 05:29:07 -0500 Received: from lists.gnu.org ([209.51.188.17]:45984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyBUW-0006yS-SE for submit@debbugs.gnu.org; Sat, 09 Jan 2021 05:29:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyBUW-0005D5-MH for bug-libtool@gnu.org; Sat, 09 Jan 2021 05:29:04 -0500 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:40226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyBUV-0001L2-4u for bug-libtool@gnu.org; Sat, 09 Jan 2021 05:29:04 -0500 Received: by mail-oi1-x22d.google.com with SMTP id p5so14462652oif.7 for ; Sat, 09 Jan 2021 02:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rWOIg89E/C4UmwzruT/O9aE24jQQFDwwf8NF4Ex6TDA=; b=jDCYHLVi0zwUHGdK+CctajPx/KDzdfZYcVTeJoObrBT4Bwjxof309pPciX+Pem7ISw JfFSYd9OyTgr+J7rFj05QbrTHdwTWWiJaz/0+TmcLEpoPU0cxKkQMHdHqL6J0y5Zprw1 MVVv44+wOhgJ7mQgJBAIsP+ZS69SjAIew802v6dXEnNHOTYUgYyqB2gz8YW0GEgibpoe 0kQ20JQM+QaIV4mu1hZPcW1IupB7+NMaGpJvPbZKuYY4TvJchURT+gqx8caAkgOr6xz/ cdf2IgHSrEzHDVby5HkdqzSFRIY8BCGNaPF8nx0o+0APANG432HMYFBZH0VXeCt8um6L kSVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rWOIg89E/C4UmwzruT/O9aE24jQQFDwwf8NF4Ex6TDA=; b=c6j+r4UKWM6gZzdHPVAzDyTtcYisfArEsm80dhOLh2UYeVq/paDY6xuGgRancCM+jQ 1syD4liXug606Z5Xn5WtGwhPL9GXKujAYEsPlUjRbGyGDCQeVYZ7B6yFP96nFxUokwZR 6cLHIn9MvEXYrn8mnucviJGzrhiP40gL12+cdeUtGmd/3KxDJQ9Prt4j83ith6hiK/P9 DUcDgW3+ulQ/keONLmNU7liZu7OpndztHbKDlRGoFr5QXOIc2LpXDvML/2shtOaDtE7T zzsBFqmKlnSYyQLWTCzzSnnp+HkQk1EdPZdgjpp+mI8SjyLbpHDK0B2BxDs7TVbkpwjl z6Vw== X-Gm-Message-State: AOAM531SOzaWhEB8Nw2iiECprAswm0xBudmHBXRSViC3kGj05/qd5ALo 5C4j+iDZHquFu4JHEbt9lN8FASPxVWRfJ9BzjjLqOVUu X-Google-Smtp-Source: ABdhPJyOCYQh3rcUhVACF/DTag9PfWc9SSnan6NW5yG+aiDniMvfpT6ap6kGA0UWIaHIQX5zRcWSaMQAatkNMXgsmZw= X-Received: by 2002:aca:4813:: with SMTP id v19mr4831225oia.119.1610188141492; Sat, 09 Jan 2021 02:29:01 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a4a:5253:0:0:0:0:0 with HTTP; Sat, 9 Jan 2021 02:29:00 -0800 (PST) From: Ozkan Sezer Date: Sat, 9 Jan 2021 13:29:00 +0300 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=sezeroz@gmail.com; helo=mail-oi1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) As the title says, libtool doesn't allow linking static libraries into a dll. Maybe it does with libtool-generated static librs with *.la companions, but that is not the case with *.a libs that come with MinGW toolchains, such as libdxguid.a, libdxerr.a, libuuid.a, and so on, which are not import libs but simply static libs. E.g: *** Warning: linker path does not have real file for library -ldxguid. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libdxguid and none of the candidates passed a file format test *** using a file magic. Last file checked: /opt/cross_win64/mingw/lib/libdxguid.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. I can workaround this particular case by defining INITGUID in the relevant source file before compiling, but it isn't nice and might not possibly work in other cases. Does libtool forbid this use by policy? -- O.S.