wxGTK (vcpkg): Error loading theme icon

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
shauser67
In need of some credit
In need of some credit
Posts: 8
Joined: Tue May 19, 2020 9:54 am

wxGTK (vcpkg): Error loading theme icon

Post by shauser67 » Thu May 21, 2020 8:34 am

Hi all,

I am having a strange problem after updating from Ubuntu 18.04 to 20.04 and installing the latest versions from vcpkg. When using a system dialog (e.g. wxMessageDialog) in my own program no GTK icons are shown and a number of warnings are displayed:
(polyklet:6767): Gtk-WARNING **: 10:01:56.991: Error loading theme icon 'gtk-no' for stock: Fatal error reading PNG image file: Invalid IHDR data

(polyklet:6767): Gtk-WARNING **: 10:01:56.991: Error loading theme icon 'gtk-yes' for stock: Fatal error reading PNG image file: Invalid IHDR data

(polyklet:6767): Gtk-WARNING **: 10:01:56.992: Error loading theme icon 'dialog-question' for stock: Fatal error reading PNG image file: Invalid IHDR data
There are no problems with other GTK programs. I am not sure if this problem is related to wxWidgets at all, maybe it is caused by the Ubuntu update or linking against an outdated library. These are the linked libraries:
wx_baseu-3.1 wx_gtk2u_adv-3.1 wx_gtk2u_aui-3.1 wx_gtk2u_core-3.1 wx_gtk2u_gl-3.1 wx_gtk2u_propgrid-3.1 wx_gtk2u_stc-3.1 wxregexu-3.1 atk-1.0 cairo gdk_pixbuf-2.0 gdk-x11-2.0 gio-2.0 glib-2.0 gobject-2.0 gthread-2.0 gtk-x11-2.0 pango-1.0 pangocairo-1.0 pangoft2-1.0
Of course I tried to google the error message, but I found no working solution for this problem.

Used versions: wxWidgets 3.1.3-1 (vcpkg) and libpng 1.6.37-9 (vcpkg).

Any help is greatly appreciated!

DavidHart
Site Admin
Site Admin
Posts: 3988
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxGTK (vcpkg): Error loading theme icon

Post by DavidHart » Thu May 21, 2020 9:30 am

Hi,

FWIW, I couldn't reproduce the problem in a 20.04 virtualbox guest, testing the 'dialogs' sample built against the wx3.1.3 obtainable from this link.

As you say, there are various possible reasons, missing entries in the icon theme being my best guess (I had a similar problem testing AppImages on 20.04; certain icons have been removed from at least one of the standard themes). I suggest you experiment, with a self-built wx3.1.3 or with the above-mentioned packages; different themes...

Regards,

David

shauser67
In need of some credit
In need of some credit
Posts: 8
Joined: Tue May 19, 2020 9:54 am

Re: wxGTK (vcpkg): Error loading theme icon

Post by shauser67 » Mon Jul 06, 2020 5:00 pm

Thanks for the advice, David!

Finally I found a solution for the problem. The errors occurred only when linking against (static) libpng16.a provided by vcpkg (version 1.6.37-9). When linking against libpng16.a provided by Ubuntu (version 1.6.37-2) all icons are rendered correctly. I am wondering if there is a bug in newer versions of the library. I'll keep an eye on it after future releases.

Best wishes

Steffen

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 4245
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxGTK (vcpkg): Error loading theme icon

Post by ONEEYEMAN » Mon Jul 06, 2020 6:05 pm

Hi,
I seriously doubt that.
It is possible that the version you use with the vcpkg is either not packaged correctly or have some configuration issues.

That is exactly why static linking on *nix-like systems is frown upon. ;-)

Thank you.

Post Reply