Linking with a particular shared library by full path overridingLD_LIBRARY_PATH - Unix

This is a discussion on Linking with a particular shared library by full path overridingLD_LIBRARY_PATH - Unix ; I need my program to always link to a particular shared library, not the one in LD_LIBRARY_PATH. Is there a way to specify shared library by full path when linking so that when running LD_LIBRARY_PATH is ignored?...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Linking with a particular shared library by full path overridingLD_LIBRARY_PATH

  1. Linking with a particular shared library by full path overridingLD_LIBRARY_PATH

    I need my program to always link to a particular shared library, not
    the one in LD_LIBRARY_PATH.

    Is there a way to specify shared library by full path when linking so
    that when running LD_LIBRARY_PATH is ignored?

  2. Re: Linking with a particular shared library by full path overridingLD_LIBRARY_PATH

    Visa Inquirer wrote:
    > I need my program to always link to a particular shared library, not
    > the one in LD_LIBRARY_PATH.
    >

    Clear LD_LIBRARY_PATH, you should never need it. If you have to use a
    poorly build application that requires it, use a wrapper script to call
    the application rather than setting LD_LIBRARY_PATH in the users
    environment.

    > Is there a way to specify shared library by full path when linking so
    > that when running LD_LIBRARY_PATH is ignored?


    Yes, commonly with the -R option.

    --
    Ian Collins.

  3. Re: Linking with a particular shared library by full path overridingLD_LIBRARY_PATH

    Ian Collins schrieb:
    > Visa Inquirer wrote:
    >> I need my program to always link to a particular shared library, not
    >> the one in LD_LIBRARY_PATH.
    >>

    > Clear LD_LIBRARY_PATH, you should never need it. If you have to use a
    > poorly build application that requires it, use a wrapper script to call
    > the application rather than setting LD_LIBRARY_PATH in the users
    > environment.
    >
    >> Is there a way to specify shared library by full path when linking so
    >> that when running LD_LIBRARY_PATH is ignored?

    >
    > Yes, commonly with the -R option.
    >

    You can even have different directories for Linking your application and
    running your application.
    The Library to link against is found with the -L option;
    The -R option tells, at which location your application shall search for
    the lib when executed.
    Maybe I confuse you, maybe it's helpful.

+ Reply to Thread