GNOME Bugzilla – Bug 766388
gobject_init_ctor (gtype.c) gets optimized out
Last modified: 2016-05-16 14:28:08 UTC
I was building Pango (and all the necessary deps, hence glib) under Visual Studio 2015 and I hit an issue: gobject_init_ctor (gtype.c:4316) seemed to get optimized out under the default Release configuration. I worked around it by disabling optimizations in the project which builds gobject.lib/gobject-***.dll The symptom I was experiencing was that as soon as pango tried to declare a type using GObject I would hit an assert to do with the type system not being initialized. I built my own tiny dll library, lifting D_DECLARE_CONSTRUCTOR to create my own simple constructor and that worked fine. Switching to debug worked, so finally I turned off optimizations for that library and it worked in release as well. Haven't a clue why it is getting optimized out, but figured I'd let y'all know.
For reference the specific compiler version is 19.00.23918 (which comes from Visual Studio 2015 Update 2).
hi Guy, We do regular builds on various different versions of Visual Studio on Windows, and this issue is not something that we've been experiencing. Is there anything unique about your configuration that might be making a difference here?
Hi Guy, It does seem that you are using an older version of GLib, as this issue was resolved in 2.46.1, and g_init_ctor() is not used on Windows builds (See bug 752837). If your GLib version is 2.46.1 or later, let me know. With blessings, and cheers! *** This bug has been marked as a duplicate of bug 752837 ***