Resolve shared libraries location at runtime ?

Discussion in 'C++' started by Apprentice, Mar 27, 2006.

  1. Apprentice

    Apprentice Guest

    Hi there,
    Is there a way in which I can specify at runtime to an application
    the locations of shared dynamic libraries on which it depends? I do
    not want to use LD_LIBRARY_PATH or other LD constructs.
    My Shared libraries can be placed any place on the system by the end
    user and I would like to use shared libraries from that location as
    specified by user in a config file or as command line arguments .
    I needed this, since I want my applications to be very portable
    across platforms and install locations. Can I implement such a
    functionality from outside my application i.e. do I need to add code
    within my application to support such a scenario or does UNIX provide
    me some means ?

    My question is two-fold:
    1. Can something that achieves this be built into my make build system?
    2. How portable would such a solution be across the various UNIX
    platforms ?

    I would really appreciate all the help I can get on this. Thanks your
    time..

    Dhanvi
    Apprentice, Mar 27, 2006
    #1
    1. Advertising

  2. Apprentice wrote:
    > Is there a way in which I can specify at runtime to an application
    > the locations of shared dynamic libraries on which it depends? I do
    > not want to use LD_LIBRARY_PATH or other LD constructs.
    > [..]


    There is no such mechanism in C++ language. There is no even such
    thing as "shared dynamic library" in C++. It's all specific to your
    platform.

    V
    --
    Please remove capital As from my address when replying by mail
    Victor Bazarov, Mar 28, 2006
    #2
    1. Advertising

  3. Apprentice wrote:
    > Hi there,
    > Is there a way in which I can specify at runtime to an application
    > the locations of shared dynamic libraries on which it depends? I do
    > not want to use LD_LIBRARY_PATH or other LD constructs.
    > My Shared libraries can be placed any place on the system by the end
    > user and I would like to use shared libraries from that location as
    > specified by user in a config file or as command line arguments .
    > I needed this, since I want my applications to be very portable
    > across platforms and install locations. Can I implement such a
    > functionality from outside my application i.e. do I need to add code
    > within my application to support such a scenario or does UNIX provide
    > me some means ?
    >
    > My question is two-fold:
    > 1. Can something that achieves this be built into my make build system?


    No

    > 2. How portable would such a solution be across the various UNIX
    > platforms ?
    >


    Not portable; Unix/Linux expect SO's to be in well known locations
    (much like Windows).

    > I would really appreciate all the help I can get on this. Thanks your
    > time..
    >
    > Dhanvi
    >


    Try posting to:

    comp.os.linux.development.apps

    Regards,
    Larry
    Larry I Smith, Mar 28, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darren
    Replies:
    10
    Views:
    1,429
    Darren
    Nov 15, 2005
  2. Replies:
    7
    Views:
    303
    Nick Keighley
    Jan 7, 2006
  3. Replies:
    1
    Views:
    10,107
  4. sunil
    Replies:
    8
    Views:
    382
    sunil
    Jun 20, 2008
  5. Replies:
    4
    Views:
    338
    Andrew Morton
    Apr 14, 2009
Loading...

Share This Page