Search code examples
cgtkgdkmultiple-definition-errorgdkpixbuf

GDK cross compilation error


I have cross-compiled libpng 1.6.28, libjpeg-turbo 1.5.1 and GLib 2.50.3 for MS Windows with i686-w64-mingw32 on Debian Stretch to a special folder, but still can't get gdk-pixbuf working. My commandline used for configure is:

./configure --host=i686-w64-mingw32 PKG_CONFIG_PATH=/usr/local/mingw32-i686/lib/pkgconfig --prefix=/usr/local/mingw32-i686

It passes the configure part fine, but problems start at making point. It throws the following error:

/usr/local/mingw32-i686/lib/libgio-2.0.a(libgio_2_0_la-giomodule.o): In function `DllMain@12':
/home/maju/GTK-build/glib-2.50.3/gio/giomodule.c:942: multiple definition of `DllMain@12'
./.libs/libgdk_pixbuf-2.0.a(libgdk_pixbuf_2_0_la-gdk-pixbuf-io.o):gdk-pixbuf-io.c:(.text+0x1ca): first defined here
collect2: error: ld returned 1 exit status
Makefile:1859: polecenia dla obiektu 'gdk-pixbuf-csource.exe' nie powiodły się

(last line is just untranslated error message for gdk-pixbuf-csource.exe).

It's also followed by warning messages:

*** Warning: This system cannot link to static lib archive libgdk_pixbuf-2.0.la.
*** 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.
*** But as you try to build a module library, libtool will still create 
*** a static module, that should work as long as the dlopening application
*** is linked with the -dlopen flag to resolve symbols at runtime.

for every required library.

Can anyone explain it to me?


Solution

  • the DllMain might mean “glib for doze doesn’t build static right”

    this patch https://lists.fedoraproject.org/pipermail/mingw/2013-March/006441.html still applies for later versions of glib. lame.

    updated version of patch https://bugzilla.redhat.com/show_bug.cgi?id=1306047

    https://bugzilla.redhat.com/attachment.cgi?id=1122789 is seemingly final version of that patch, see

    https://smani.fedorapeople.org/glib-prefer-constructors-over-DllMain.patch

    Not sure about the cannot link, I configure glib for cross compile like --host=i686-w64-mingw32 --prefix=/Users/rdp/dev/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32 --disable-shared --enable-static --with-pcre=internal FWIW