Why do I get 'error while loading shared libraries: libGL.so.1: wrong ELF class: ELFCLASS64' when I run Mercury? [closed]
Solution 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 :
#!/bin/bash
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.