GNU bug report logs - #45738
cannot link a static library into a dll

Previous Next

Package: libtool;

Reported by: Ozkan Sezer <sezeroz <at> gmail.com>

Date: Sat, 9 Jan 2021 10:30:01 UTC

Severity: normal

To reply to this bug, email your comments to 45738 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-libtool <at> gnu.org:
bug#45738; Package libtool. (Sat, 09 Jan 2021 10:30:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ozkan Sezer <sezeroz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-libtool <at> gnu.org. (Sat, 09 Jan 2021 10:30:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ozkan Sezer <sezeroz <at> gmail.com>
To: bug-libtool <at> gnu.org
Subject: cannot link a static library into a dll
Date: Sat, 9 Jan 2021 13:29:00 +0300
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.




This bug report was last modified 3 years and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.