GNU bug report logs -
#41152
DLL_EXPORT in libtool.m4
Previous Next
Full log
View this message in rfc822 format
When building a shared library (dll) on windows (msys2; but also other environments) using libtool,
libtool.m4 defines -DDLL_EXPORT - which is mentioned in libtool.m4 as being a 'hack'.
In a normal situation this doesn't have an obvious ill effect, but if you are attempting to build a
dll whose linkage to all other libraries (e.g. pthread) is static (as is sometimes desirable if e.g.
building a plugin) this results in all object files being contaminated with symbols for dynamic
pthread which then fail at link time, because of course pthread is only statically linked.
I believe this hack does more harm than good and should be removed, it is common practice on windows
that if you want exports/imports you should request them by setting the define yourself, so I don't
see why libtool attempts to automatically set this.
Should it not be possible to remove the hack, there should at least be some way to turn it off,
currently I have to now "#undef DLL_EXPORT" all over my codebase which is messy and undesirable.
Regards,
Malcolm MacLeod
This bug report was last modified 5 years and 102 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.