After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694342 - Problems running gtk3-demo on Windows builds after port to GResources
Problems running gtk3-demo on Windows builds after port to GResources
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.7.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 694341 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-02-21 08:08 UTC by Fan, Chun-wei
Modified: 2013-02-27 04:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fan, Chun-wei 2013-02-21 08:08:34 UTC
Hi,

Not too long ago, the gtk demo program was extensively ported to GResources, but however, when I was running the gtk3-demo program, most of the resources (the sources to display in the demo window, images, etc.) failed to load.  If I read the commit message correctly, I thought I would no longer need to install the demo data files as they have been built into the resources.

In case this might sound interesting to people, I was able to successfully run the resources test program from glib/gio.

With blessings, thank you!

These are the messages that are displayed, for references:
---

(gtk3-demo.exe:5776): Gtk-CRITICAL **: file ..\..\..\gtk\gtkwindow.c: line 3956:
 assertion `GDK_IS_PIXBUF (icon)' failed

(gtk3-demo.exe:5776): Glib-GObject-CRITICAL **: file ..\..\..\gobject\gobject.c:
 line 2916: assertion `G_IS_OBJECT (object)' failed

** (gtk3-demo.exe:5776): WARNING **: Cannot open source for application.c: The r
esource at '/sources/application.c' does not exist


** (gtk3-demo.exe:5776): WARNING **: Cannot open source for appwindow.c: The res
ource at '/sources/appwindow.c' does not exist

**
ERROR:..\..\..\demos\gtk-demo\appwindow.c:322:register_stock_icons: assertion fa
iled: (pixbuf)

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

c:\gnome.build.unstable\gtk+-3.7.11\demos\gtk-demo>gtk3-demo

(gtk3-demo.exe:3432): Gtk-CRITICAL **: file ..\..\..\gtk\gtkwindow.c: line 3956:
 assertion `GDK_IS_PIXBUF (icon)' failed

(gtk3-demo.exe:3432): Glib-GObject-CRITICAL **: file ..\..\..\gobject\gobject.c:
 line 2916: assertion `G_IS_OBJECT (object)' failed

** (gtk3-demo.exe:3432): WARNING **: Cannot open source for application.c: The r
esource at '/sources/application.c' does not exist


** (gtk3-demo.exe:3432): WARNING **: Cannot open source for combobox.c: The reso
urce at '/sources/combobox.c' does not exist


** (gtk3-demo.exe:3432): WARNING **: Cannot open source for pixbufs.c: The resou
rce at '/sources/pixbufs.c' does not exist


(gtk3-demo.exe:3432): Glib-CRITICAL **: file ..\..\..\glib\gmain.c: line 2191: a
ssertion `tag > 0' failed

** (gtk3-demo.exe:3432): WARNING **: Cannot open source for pickers.c: The resou
rce at '/sources/pickers.c' does not exist
---
Comment 1 Fan, Chun-wei 2013-02-21 08:09:35 UTC
*** Bug 694341 has been marked as a duplicate of this bug. ***
Comment 2 tarnyko 2013-02-25 10:18:55 UTC
Same behavior here with librsvg compiled and functional. So it's not a .svg format problem but likely a GResource locating on Win32 one.

Filemon shows demo trying to load files like "emblem-default-symbolic" (without .svg extension) in shared places like c:/usr/share/pixmaps, but moving it there does not help. Maybe a format detection problem.
Comment 3 Fan, Chun-wei 2013-02-27 04:37:22 UTC
Hi,

After some further investigations, it seemed that demo_resources.c did not really get linked into the gtk3-demo binary, as the stuff in there was ignored by a linker optimization.  I have managed to fix this issue, at least on the Visual Studio builds, by turning off WholeProgramOptimization in commit ed5649a4 ("Fix gtk3-demo Visual Studio projects").  DOH! :)

So, tarnyko, can you check whether your compiled resource sources is really linked in your program/library?

Will close this bug now.