When a statically linked version of the library is used, the clock/thread
init functions aren't called - this results in segfaults in various windows
functions (and of course the app doesn't work).
diff -rpu glib-2.32.2.orig/glib/glib-init.c glib-2.32.2/glib/glib-init.c
--- glib-2.32.2.orig/glib/glib-init.c	2012-04-12 23:39:20.000000000 +0000
+++ glib-2.32.2/glib/glib-init.c	2012-06-19 10:22:38.000000000 +0000
@@ -221,10 +221,11 @@ glib_init (void)
   g_debug_init ();
 }
 
-#if defined (G_OS_WIN32)
 
 HMODULE glib_dll;
 
+#if defined (G_OS_WIN32) && SHARED_BUILD
+
 BOOL WINAPI
 DllMain (HINSTANCE hinstDLL,
          DWORD     fdwReason,
@@ -261,6 +262,12 @@ G_DEFINE_CONSTRUCTOR(glib_init_ctor)
 static void
 glib_init_ctor (void)
 {
+  /* TODO: Should glib_dll be here, so that we find resources also for
+   * static-linked app?
+   * glib_dll = GetModuleHandle(NULL);
+   */
+  g_clock_win32_init ();
+  g_thread_win32_init ();
   glib_init ();
 }
 
