Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Bug Issues using so-libs with SONAME set

Discussion in 'Linux Editor' started by elmir-jagudin, Feb 6, 2019.

  1. elmir-jagudin

    elmir-jagudin

    Joined:
    Jun 7, 2016
    Posts:
    6
    I have run into a problem using the SO-libraries where the SONAME
    is set to a string that does not end in .so.

    For example, consider I have a library 'foo', which includes a version number
    into it's SONAME. When I build it I'll get these two files:

    libfoo.so -> libfoo.so.1
    libfoo.so.1

    the SONAME will be set to 'libfoo.so.1'. For the record, this is a common way to handle library versioning on Linux.

    When I build a second library 'bar' and link it agains 'foo', it will create a link
    to libfoo.so.1 file.

    $ ldd libbar.so
    libfoo.so.1 => ./libfoo.so.1 (0x00007feabceee000)
    ...

    If I use the libbar outside of Unity, all works as expected, when loading
    'libbar', linker will look for 'libfoo.so.1' file, and via symlink load the
    libfoo.so file.

    However, if I put libfoo.so, libfoo.so.1 and libfoo.so inside unity project's
    Assets/Plugins directory and try to use code in libbar, it does not work.
    I'll get following error:

    Plugins: Couldn't open Assets/Plugins/libbar.so, error: libfoo.so.1: cannot open shared object file: No such file or directory

    Here is an example project that demonstrates this problem:

    https://github.com/elmirjagudin/soname

    It looks like unity only consideres *.so files as library files, thus when SONAME does not
    end in '.so', it does not work.

    Have anyone run into this problem? Is there any work-arounds?
     
    Last edited: Feb 6, 2019