Tix problem solved (Red Hat 7.x -> XLowerWindow undefined)

Ben Caradoc-Davies ben at wintersun.org
Mon Feb 10 19:54:33 EST 2003


I have a simple workaround for an annoying Tix problem on Red Hat 7.x systems.
The problem occurs with a binary tix RPM package (e.g. Red Hat tix-8.2.0b1-65)
and Python 2.2 compiled from source. The problem manifests as Tix.Tk() failing
with

    TclError: couldn't load file "/usr/lib/libtix": /usr/lib/libtix.so:
    undefined symbol: XLowerWindow

rendering Tix unuseable. This has been reported a few weeks ago on
comp.lang.python.

The problem is that the RPM libtix.so is not linked against libX11.so, and when
_tkinter.so loads the former dynamically, many symbols can't be resolved
(starting with XLowerWindow). By comparison, tixwish works normally as it is
linked against both libtix.so and libX11.so.

The solution is to explicitly link _tkinter.so against libtix.so, so that
references to libX11.so can be resolved when _tkinter.so itself is loaded
(_tkinter.so is already linked against libX11.so).

Somewhere in setup.py for Python 2.2 is the following:

        # Add the Tcl/Tk libraries
        libs.append('tk'+version)
        libs.append('tcl'+version)

Insert a line to have _tkinter.so linked against libtix.so:

        # Add the Tcl/Tk libraries
        libs.append('tix')
        libs.append('tk'+version)
        libs.append('tcl'+version)

then

    python setup.py build
    python setup.py install
    
as usual. A more generic solution would add this entry only if Tix was
available, but this quick workaround works for me.

-- 
Ben Caradoc-Davies <ben at wintersun.org>
http://wintersun.org/
Imprisonment on arrival is the authentic Australian immigration experience.




More information about the Python-list mailing list