Thread: Dynamic libraries

  1. #1
    Unregistered
    Guest

    Question Dynamic libraries

    I am totally confused about the whole dynamic libraries concept. could someone give a brief description of what they are and why they are used, or point me in the right direction (google was giving nothing away).

    most of all though; as I understand it, dynamic libraries are ones that are 'called' at runtime (?). How does the program locate the mentioned DL ???

    any help appreciated

    gaz

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >How does the program locate the mentioned DL ???
    The executable contains filenames that the loader uses to find the libraries at runtime. This is good because it makes the executable considerably smaller than statically linked programs, where the executable contains complete copies of the libraries. One can also create several executables that link to the same libraries, so it's not as wasteful there either.

    -Prelude
    My best code is written with the delete key.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    >>How does the program locate the mentioned DL ???

    There is a predefined search method (with windows anyway)....

    It goes somthing like;

    [list=1][*]The directory from which the application loaded. [*]The current directory for the process[*]The system directory (\windows\system or \windows\system32 depending on OS)[*]The windows directory[*]Whatever you have listed in the PATH environment [/list=1]

    You can also load the dlls at runtime afer execution of your code has started.....with this you can also specify alternate locations.

  4. #4
    Unregistered
    Guest

    Smile

    Great - that search order is what I am looking for: does anyone know the search order for *nix?
    I take it that it is similar but with /usr/lib rather than winnt/system32??

    cheers

  5. #5
    Registered User lliero's Avatar
    Join Date
    Oct 2001
    Posts
    59

    hi

    i want to add on what prelude said,,


    dll - are dynamic libraries..

    we have in process dll and outprocess dll

    in process dll are dll that executes within a process

    while outprocesss dll, obviously execute outside the process..

    so what are these things?

    in an in processDll
    when an application crashes it crashes the dll too
    together with those other application with it..

    in an outprocess
    when an application crashes it does not crahes the
    dll..


    i hope i contributed something
    " programming is 1% syntax and 99% logic "

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dynamic libraries
    By kris.c in forum C Programming
    Replies: 9
    Last Post: 01-13-2007, 07:14 AM
  2. MinGW thread-safe runtime libraries
    By Mario F. in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2006, 08:15 AM
  3. Identify dynamic IP address of network device
    By BobS0327 in forum Tech Board
    Replies: 2
    Last Post: 02-21-2006, 01:49 PM
  4. Dynamic Libraries and definition files
    By IconTree in forum Linux Programming
    Replies: 1
    Last Post: 08-10-2005, 01:51 PM
  5. operator overloading and dynamic memory program
    By jlmac2001 in forum C++ Programming
    Replies: 3
    Last Post: 04-06-2003, 11:51 PM