dependency problems in Ubuntu ?

I needed to install python-gtk2-dev and python-gnome2-dev in order to "compile" Band Saw. When I ran bandsaw.py as a test, I got what looks like a dependency problem:


guest@berta:~/Steven/Projects/bandsaw/bandsaw-0.3.0/src$ python bandsaw.py
Traceback (most recent call last):
File "bandsaw.py", line 31, in ?
import egg.trayicon
ImportError: /usr/lib/libgtk-x11-2.0.so.0: undefined symbol: gdk_font_from_description_for_display
guest@berta:~/Steven/Projects/bandsaw/bandsaw-0.3.0/src$


Apparently, the "gdk_font_from_description_for_display" function is deprecated. But libgtk2 still uses it.

I'm not sure how to fix that yet.

[Update]

The problem is caused by a the library /usr/lib/libgdk-x11-2.0.so.0 (Mind GDK vs GTK). This library has a function called Gdk_font_from_description_for_display with uppercase G, probably to denote that the function is deprecated and shouldn't be called.

While I wait for my subscription mail to the Ubuntu bugtracker to report this as a bug, I whipped up a quick hack.
I just create the function with lowercase first letter, and call the function with uppercase first letter.

In the file gdk_font_from_description_for_display.c:

void *gdk_font_from_description_for_display(void *display, void *font_desc) {
return Gdk_font_from_description_for_display(display, font_desc);
}


Compile this with:

gcc -fPIC -g -c -Wall gdk_font_from_description_for_display.c
gcc -shared -Wl,-soname,libmystuff.so.1 -o libmystuff.so.1.0.1 gdk_font_from_description_for_display.o -lc


Don't worry about the warnings ;) They can be ignored safely.

Now to use this library:

guest@berta:~/.../src$ LD_PRELOAD=/.../libmystuff.so.1.0.1 python bandsaw.py


You can read more about creating shared libraries here: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html

[Update]
I reported the bug here:
https://launchpad.net/ubuntu/+source/gtk+2.0/+bug/99932