diff -ruN sources-original/gtk/gdk/win32/gdkmain-win32.c sources/gtk/gdk/win32/gdkmain-win32.c
--- sources-original/gtk/gdk/win32/gdkmain-win32.c	2011-08-16 04:04:34 +0200
+++ sources/gtk/gdk/win32/gdkmain-win32.c	2011-10-03 00:07:55 +0200
@@ -65,6 +65,7 @@
   { NULL }
 };
 
+#ifndef GDK_STATIC_COMPILATION
 BOOL WINAPI
 DllMain (HINSTANCE hinstDLL,
 	 DWORD     dwReason,
@@ -74,6 +75,7 @@
 
   return TRUE;
 }
+#endif
 
 void
 _gdk_win32_windowing_init (void)
diff -ruN sources-original/gtk/gtk/gtkmain.c sources/gtk/gtk/gtkmain.c
--- sources-original/gtk/gtk/gtkmain.c	2011-08-16 04:04:34 +0200
+++ sources/gtk/gtk/gtkmain.c	2011-10-03 00:09:19 +0200
@@ -131,8 +131,9 @@
 
 #ifdef G_OS_WIN32
 
-static HMODULE gtk_dll;
+static HMODULE gtk_dll = 0;
 
+#ifndef GTK_STATIC_COMPILATION
 BOOL WINAPI
 DllMain (HINSTANCE hinstDLL,
          DWORD     fdwReason,
@@ -147,6 +148,7 @@
 
   return TRUE;
 }
+#endif
 
 /* These here before inclusion of gtkprivate.h so that the original
  * GTK_LIBDIR and GTK_LOCALEDIR definitions are seen. Yeah, this is a
