Solution for Gtk-WARNING **: ... : wrong ELF class: ELFCLASS64

(eclipse:13576): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so: wrong ELF class: ELFCLASS64

If you get the above error message in a 64 bit Linux system while trying to run a 32 bit application using GTK 2 (like Eclipse), it means that GTK is picking up the wrong (64 bit) version of a plugin library. The first step is, of course, to check that the 32 bit version of the library is available (example location in Debian/Ubuntu; I first extracted the library from the i386 package and moved it to this location):

jpl@debian:~$ file /emul/ia32-linux/usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so /emul/ia32-linux/usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

Even though the 32 bit version exists and is available in the library search path used by the dynamic linker, GTK insists on using the 64 bit version.

Changing LD_LIBRARY_PATH, adding the particular library to LD_PRELOAD, changing -Djava.library.path do not fix the problem. However, a similar easy solution exists - override the search path by setting the GTK_PATH environment variable in a wrapper script for the 32 bit application in question:

export GTK_PATH=/emul/ia32-linux/usr/lib/gtk-2.0

This issue has been reported as Debian bug 490947 and Ubuntu bug 190227. Reports elsewhere linked it to RealPlayer, however this appears to be a problem with the (packaging of) the GTK2 library, so various applications are affected.

5 comments:

Anonymous said...

Thanks for this is was very useful

martin

MAIDEN said...

3 years later, this post is still usefull !
Managed to make skype 2.2 work fluently on 64Bits Debian.

It was working almost fine, but insulted me with the wrong class of libpixmap.so and looked pretty ugly. Now, it just look like all of my other applications (GTK Themes & all :p).

jpl said...

Cool. As a matter of fact, in the period since I wrote it I managed to forget all about it myself, then ran into this same problem once again, found my own post via Google and helped myself...

MAIDEN said...

Looked this again today, with the new skype beta, same problem & same solution (minus the path: /usr/lib32/gtk-2.0)

Anonymous said...

this is a great. Thanks,

Post a Comment