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, ...
- 12-19-2008 #1Just 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
or you could directly assign the LD_LIBRARY_PATH to the lib inside the script.Code:source /etc/profile
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.
- 12-19-2008 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
It sounds like in /etc/profile you need to:
after you define LD_LIBRARY_PATH.Code:export LD_LIBRARY_PATH
- 12-20-2008 #3Just 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 ?
- 12-20-2008 #4Linux 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.
- 12-20-2008 #5Just 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.


Reply With Quote