Find the answer to your Linux question:
Results 1 to 5 of 5
Hi everybody, Sometimes, when I run scripts which invokes sub programs and these programs need to load some shared libraries. My shell has the LD_LIBRARY_PATH contains link to lib directories, ...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    14

    Shell script and 'error while loading shared libraries: libimf.so'

    Hi everybody,
    Sometimes, when I run scripts which invokes sub programs and these programs need to load some shared libraries. My shell has the LD_LIBRARY_PATH contains link to lib directories, so I could run these programs directly from my shell.
    However, when I run the scripts also in my shell and I get :

    <name a particular program>: error while loading shared libraries: libimf.so

    Although, this program run properly when call directly from my shell.

    The solution is adding a line to the shell script

    Code:
    source /etc/profile
    or you could directly assign the LD_LIBRARY_PATH to the lib inside the script.

    Now, the problem is that I have a binary program which calls another programs and result error likes above.
    I try putting this binary program in to a script with "source /etc/profile" but not worth.
    Could anyone solve this problem ?
    Any suggestion please.

    Thank you.

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    It sounds like in /etc/profile you need to:
    Code:
    export LD_LIBRARY_PATH
    after you define LD_LIBRARY_PATH.

  3. #3
    Just Joined!
    Join Date
    Apr 2007
    Posts
    14
    Yes, of course, I have already had

    export LD_LIBRARY_PATH

    after define LD_LIBRARY_PATH

    Thank you, could you suggest any more, please ?

  4. #4
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    Some random thoughts:

    Your /etc/profile isn't executed when you log in. Check the permissions, is it 644 and root the owner. Put an 'echo $LD_LIBRARY_PATH' at the end to see if it executes when you log in.

    Do a 'echo $LD_LIBRARY_PATH' before you 'source /etc/profile' to see what it is after you log in. Maybe you're also defining it somewhere else like .bashrc

    Post the links here. Maybe it has something to do how you have the symlinks defined.

  5. #5
    Just Joined!
    Join Date
    Apr 2007
    Posts
    14
    my problem is far from this.
    I have already had LD_LIBRARY_PATH set directly after login.
    Maybe I do not state the problem clearly, please read again my first post.
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...