The Environment:
Windows 11, GTK4 and libadwaita-1 provided by MinGW64.
The Problem:
When the application is run on the test VM, the gdk-pixbuf svg module is not being found at runtime and svg’s are not loading.
The Situation:
The application runs as expected on my Windows 11 development machine but after I package the binary and supporting files, SVG files will not load on the Windows 11 testing VM.
The file structure is what many have suggested (namely here) through various posts, following the format of:
├ bin
├─app.exe
├─gdk-pixbuf-query-loaders.exe
├─ … (dll’s)
├ lib
├─gdk-pixbuf-2.0
├── 2.10.0
├─── loaders
├──── libpixbufloader-png.dll
├──── libpixbufloader-svg.dll
├──── …
├─── loaders.cache
├ share
├─glib-2.0
├── schemas
├─── …
├─icons
├── adwaita
├─── …
My Windows install script uses ldd to find and copy the dependencies of the binary, which includes librsvg-2-2.dll. I intend to run gdk-pixbuf-query-loaders after installing on the testing VM to update the loaders.cache file, so I also search and include it’s dependencies in my bin folder.
Attempts to Fix:
Following the thread from this post, I rebuilt gdk-pixbuf from source with -Dbuiltin_loaders=all
, -Drelocatable=true
and -Dnative_windows_loaders=true
. Running gdk-pixbuf-query-loaders.exe --update-cache
on the test vm creates the loaders.cache file in the lib\gdk-pixbuf-2.0\2.10.0
directory with # LoaderDir = c:\lib\gdk-pixbuf-2.0\2.10.0\loaders
at the end of the file.
Perhaps some of my environment variables are not set correctly for the project? I must admit, I do not have a great understanding of what they should be in my particular case (trying to run the app outside of the dev environment).
What is strange is that the console log can point to where libpixbufloader-svg is but says that the module cannot be found. Maybe I am missing another dependency that isn’t being picked up by my script?
From the test VM:
(eosMonosync.exe:6996): Gtk-WARNING **: 14:46:45.290: Failed to load icon C:\Users\arctagon\Documents\eosMonosync\share\icons\Adwaita/symbolic/status\weather-clear-symbolic.svg: Unable to load image-loading module: C:\Users\arctagon\Documents\eosMonosync\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-svg.dll: ‘C:\Users\arctagon\Documents\eosMonosync\lib\gdk-pixbuf-2.0\2.10.0\loaders\libpixbufloader-svg.dll’: The specified module could not be found.
Advice would be greatly appreciated! Thanks