Saturday, July 18, 2009

GTK 2.6.10 Fix: To Make libpixbufloader-png.dll etc.

While I was compiling GTK+ 2.6.10 for Windows 98/ME with MinGW, I received the following error:


failed to load "./stock_about_16.png": Couldn't recognize the image file
format for file './stock_about_16.png'

After many fruitless searches and recompile, I finally tracked the cause of this problem to missing libpixbufloader-png.dll. Here, I show how I fixed the problem by using dllwrap to produce libpixbufloader-*.dll from static counterparts.


First, go to the epicenter ~/gtk+-2.6.10/gdk-pixbuf/.libs


cd ~/gtk+-2.6.10/gdk-pixbuf/.libs

Now, just run the following commands to produce *pixbufloader* modules.


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-ani.dll --dllname libpixbufloader-ani.dll io-ani.o io-ani-animation.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-bmp.dll --dllname libpixbufloader-bmp.dll io-bmp.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-gif.dll --dllname libpixbufloader-gif.dll io-gif.o io-gif-animation.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-ico.dll --dllname libpixbufloader-ico.dll io-ico.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-jpeg.dll --dllname libpixbufloader-jpeg.dll io-jpeg.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -ljpeg -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-pcx.dll --dllname libpixbufloader-pcx.dll io-pcx.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-png.dll --dllname libpixbufloader-png.dll io-png.o -L/mingw/lib -lpng12 -lz -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-pnm.dll --dllname libpixbufloader-pnm.dll io-pnm.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-ras.dll --dllname libpixbufloader-ras.dll io-ras.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-tga.dll --dllname libpixbufloader-tga.dll io-tga.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-tiff.dll --dllname libpixbufloader-tiff.dll io-tiff.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -ltiff -ljpeg -lz -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-wbmp.dll --dllname libpixbufloader-wbmp.dll io-wbmp.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-xbm.dll --dllname libpixbufloader-xbm.dll io-xbm.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


dllwrap --export-all-symbols --add-stdcall-alias -o libpixbufloader-xpm.dll --dllname libpixbufloader-xpm.dll io-xpm.o -L. -lgdk_pixbuf-2.0 -L/mingw/lib -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lws2_32 -lole32 -lintl


Then, run gdk-pixbuf-query-loaders to generate the file gdk-pixbuf.loaders.


gdk-pixbuf-query-loaders.exe libpixbufloader-*.dll > ../gdk-pixbuf.loaders

This will let you resume compiling GTK+ 2.6.10. After successfully compiling GTK+, remember to copy these DLL files in /mingw/lib/gtk-2.0/2.4.0/loaders and run gdk-pixbuf-query-loaders.


cp libpixbufloader-*.dll /mingw/lib/gtk-2.0/2.4.0/loaders

gdk-pixbuf-query-loaders /mingw/lib/gtk-2.0/2.4.0/loaders/*.dll > /mingw/etc/gtk-2.0/gdk-pixbuf.loaders

No comments:

Post a Comment

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger