Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Using native OpenGL

/home/software/Mercury_3.3/c_linux/bin/mercury.x: error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS64
share|improve this question

closed as unclear what you're asking by guntbert, Braiam, Eric Carvalho, Richard, Lucio Apr 1 '14 at 2:32

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Could you at least explain what are you trying to do? –  Braiam Mar 31 '14 at 0:50

1 Answer 1

Looks like your application is a 32 bits application but is trying to load a 64bits library. On a 64bits installation, you can have both version (32 bits and 64 bits) of any libraries installed. 32bits can be found under /usr/lib32 and 64bits under /usr/lib64.

On Linux, libraries are search using a path sequence, a little bit like the PATH variable list all the directories to look for the executable you want to run when no path is given. This sequence to search for libraries is defined in a variable called LD_LIBRARY_PATH.

The problem is that the directory for the 64bits versions comes before the directory with the 32bits versions. And usually the name of the library is identical for the 32bits and 64bits version.

You can overcome this problem by creating a small startup script for your application like this one :


export LD_LIBRARY_PATH=/usr/lib32:/usr/lib64:$LD_LIBRARY_PATH

<your binary> $*

If there is already a script to start this application, you can just add the line

export LD_LIBRARY_PATH=/usr/lib32:/usr/lib64:$LD_LIBRARY_PATH

to it, near the top.

I'll prefer the first method, creating a specific script, as any startup script provided by the package will be probably overwritten in case of update.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.