LD_LIBRARY_PATH - Solaris

This is a discussion on LD_LIBRARY_PATH - Solaris ; Hello, I'm trying to change, in a small C program, the contents of LD_LIBRARY_PATH with putenv() to "dlopen"ing my shared object... but it seems it doesn't work Do you have another solution ? please help me guys... thanx...

+ Reply to Thread
Results 1 to 3 of 3

Thread: LD_LIBRARY_PATH

  1. LD_LIBRARY_PATH

    Hello,

    I'm trying to change, in a small C program, the contents of
    LD_LIBRARY_PATH with putenv() to "dlopen"ing
    my shared object... but it seems it doesn't work

    Do you have another solution ?

    please help me guys...


    thanx


  2. Re: LD_LIBRARY_PATH

    On Fri, 10 Feb 2006 16:30:12 -0800, stef wrote:

    > I'm trying to change, in a small C program, the contents of
    > LD_LIBRARY_PATH with putenv() to "dlopen"ing
    > my shared object... but it seems it doesn't work


    Solaris uses ELF binaries; the library search path is included in the
    binary's header at link time. Read the man pages ld(1) and ld.so.1(1).


  3. Re: LD_LIBRARY_PATH

    On Fri, 10 Feb 2006, stef wrote:

    > I'm trying to change, in a small C program, the contents of
    > LD_LIBRARY_PATH with putenv() to "dlopen"ing
    > my shared object... but it seems it doesn't work


    A process can't change the environment of any other, including its
    parent.

    > Do you have another solution ?


    LD_LIBRARY_PATH should rarely, if ever, be used. The corrrect approach
    (if you have source) is to link with -R.

    --
    Rich Teer, SCNA, SCSA, OpenSolaris CAB member

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-group.com/rich

+ Reply to Thread