I have my c++ project on rhel6 and it works fine.
But on a rhel7 machine, it throws the following error :
ImportError: liblzma.so.0: cannot open shared object file: No such
file or directory
Now, I see, that on rhel7 machine we have :
$ ldconfig -p | grep "liblzma"
liblzma.so.5 (libc6,x86-64) => /lib64/liblzma.so.5
liblzma.so.5 (libc6) => /lib/liblzma.so.5
liblzma.so (libc6,x86-64) => /lib64/liblzma.so
and on rhel6 machine we have :
$ ldconfig -p | grep liblzma
liblzma.so.0 (libc6,x86-64) => /usr/lib64/liblzma.so.0
liblzma.so (libc6,x86-64) => /usr/lib64/liblzma.so
How can I correct this error?
Since rhel6 build executables should/can work on rhel7. (any later version of rhel6)
2
Answers
Simply creating a link on RHEL7 machine will do the job.
Then you can add the directory in which the link was created to the enviornment variable "LD_LIBRARY_PATH". This env variable is used to find dynamic libraries your code wants to use.
The older version of the library required (
/usr/lib64/liblzma.so.0
) is provided by packagexz-compat-libs
. So simply: