dependency problems in Ubuntu ?

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

[email protected]:~/Steven/Projects/bandsaw/bandsaw-0.3.0/src$ python
Traceback (most recent call last):
File "", line 31, in ?
import egg.trayicon
ImportError: /usr/lib/ undefined symbol: gdk_font_from_description_for_display
[email protected]:~/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.


The problem is caused by a the library /usr/lib/ (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, -o gdk_font_from_description_for_display.o -lc

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

Now to use this library:

[email protected]:~/.../src$ LD_PRELOAD=/.../ python

You can read more about creating shared libraries here:

I reported the bug here: