skip to Main Content

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


  1. Chosen as BEST ANSWER

    Simply creating a link on RHEL7 machine will do the job.

    $ ln -s  /lib64/liblzma.so  liblzma.so.0
    

    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.


  2. The older version of the library required (/usr/lib64/liblzma.so.0) is provided by package xz-compat-libs. So simply:

    yum install xz-compat-libs
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search