Menu

7zG missing 7z.so and not linked

Help
2017-09-11
2020-12-29
  • Danie de Jager

    Danie de Jager - 2017-09-11

    The linking to the Library for 7zG is not working as expected.

    I built the latest version, 16.02 and used the installation script. All the 7z commands work as expected except for 7zG. When it is run as 7zG a test.7z it will fail. Different options tried running the command:

    7zG a test
    /usr/local/bin/7zG a test

    The error is for both the commands will be the same:

    Can't load '/usr/local/bin/7z.dll' (/usr/local/bin/7z.so: cannot open shared object file: No such file or directory)
    

    When I copy 7z.so to /usr/local/bin and run /usr/local/bin/7zG a test does it work correctly. it seems like 7zG does not look inside the Path or installed location /usr/local/lib/p7zip/7z.so for the library. Strange that 7zG is working when I copy the library to the same directory as the binary inside /usr/local/bin. The library is expected to be in the locationion from whic it is executed.

    Running the command will pop up a GUI showing the progress of the 7zG command as expected.

     

    Last edit: Danie de Jager 2017-09-11
  • halo117nachos

    halo117nachos - 2020-12-29

    Typically, p7zip's executable binaries are located in /usr/share/lib/p7zip, /usr/local/share/lib/p7zip, /usr/lib/p7zip, or somewhere similar (depending on how it was packaged, and/or whether you built it from source yourself), with the 7z.so library file being in the same location. Since this location is not likely to be in the PATH variable, these binaries come with shell scripts to pass arguments to commands with explicit arguments. For instance:

        #! /bin/sh
        exec /usr/lib/p7zip/7z "$@"
    

    The above code can often be found in /usr/bin/7z. There are similar files for 7za, 7zr, 7zFM, and 7zG.

    I would advise you to do something similar: place 7zG and 7z.so in the same location, and use a shell script to call /wherever/7zG. Name that script 7zG, make it executable, and put it somewhere where you can call it whenever you need to.

     

Log in to post a comment.