[sword-devel] Linux: Linking to Sword library with potentially different names

pierre amadio amadio.pierre at gmail.com
Tue Apr 16 23:40:28 MST 2019


Hello.

Chances are making a symlink of the 11v5 library to a sword1.8.so file
will fail as the prototype of the function may not be the same between
the 2 versions (may be some new function were added as well).

You can try to play with :

1) LD_PRELOAD to tell the linker to override a default .so with
something you choose instead.
https://stackoverflow.com/questions/426230/what-is-the-ld-preload-trick#426260

2) LD_LIBRARY_PATH to tell the linker where to look for .so.

On my debian/ubuntu system, i keep the original sword installed for
prepackaged apps, and I install the latest one "in a corner" for home
made stuff.

I took some notes on how to install a custom sword on debian/ubuntu there:
https://github.com/pierre-amadio/SwordSandBox/blob/master/notes.txt

Line 28 to 33 cover the compilation of sword in /usr/local/sword
Line 52 to 56 cover environnment variable needed to use this library
at runtime (LD_LIBRARY_PATH,  PATH)  and to compile other stuff
against it.


On Wed, 17 Apr 2019 at 08:13, Tobias Klein <contact at tklein.info> wrote:
>
> Hi,
>
> I need some advice from you Linux experts.
>
> Cyrille tested Ezra Project on Linux and couldn't run it, because the
> Sword package on that system (custom Sword 1.8.1 on Ubuntu 18.04)
> contains a differently named *.so file than on my system (Default Sword
> package from Ubuntu 18.04 => libsword11v5).
>
> What can I do to support multiple *.so variants with the same binary? Is
> there a way to do that?
>
> I was thinking about creating a symlink within my application directory
> structure that can be adjusted at runtime based on some dynamic system
> inspection code.
>
> Best regards,
> Tobias
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page



More information about the sword-devel mailing list