"DllMain" function in static libraries (mingw32-glib2-static)

Gavin Smith gavinsmith0123 at gmail.com
Sat Mar 23 09:04:08 UTC 2013


I have been trying to use the Fedora static build of glib, as I cannot
compile from source myself due to other problems that Fedora appear to have
fixed. I have extracted the mingw32-glib2-2.35.8-1.fc19
and  mingw32-glib2-static-2.35.8-1.fc19 rpm's, and the libraries and header
files are under the default location
(/usr/i686-w64-mingw32/sys-root/mingw/). I have been using the Cygwin
i686-w64-mingw32 cross-compiling tools, although that should not be
relevant.

I encounter a problem with duplicated symbols when linking against libgsf:

/usr/i686-w64-mingw32/sys-root/mingw/lib/libglib-2.0.a(libglib_2_0_la-glib-init.o):(.text+0x240):
multiple definition of `_DllMain at 12'
/usr/i686-w64-mingw32/sys-root/mingw/lib/libgsf-1.a(gsf-utils.o):(.text+0x140):
first defined here

$ nm /usr/i686-w64-mingw32/sys-root/mingw/lib/libglib-2.0.a | grep DllMain
00000240 T _DllMain at 12

I heard that DllMain symbols should not appear in static libraries because
they do not get called and if more than library does it they conflict. Both
glib and libgsf libraries do this, however. (This problem appears both when
I compile libgsf from source and when I use the Fedora MinGW libgsf
package.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/mingw/attachments/20130323/57894a6a/attachment.html>


More information about the mingw mailing list