I'm trying to change the LD_LIBRARY_PATH
from my C++ program. I'm able to get its value using getenv("LD_LIBRARY_PATH")
and set its value using setenv()
(and I know that this is working, because when I call getenv("LD_LIBRARY_PATH")
again, I get the updated value), but changing its value from inside the program isn't having any effect on it: I still get this error-message:
Failed to Load the shared library file
If I set the value before the executable gets loaded or the application is started, it works fine.
LD_LIBRARY_PATH
beforeexec
-ing the binary ELF executable. This is common practice (most distributions are doing this forfirefox
) – Academicianchmod a+x filename.sh
, putfilename.sh
inside some directory in yourPATH
and you can run it simply asfilename.sh
– Academician$HOME/bin/filename.sh
or/usr/local/bin/filename.sh
. Look insidefirefox
ormozilla
; it is generally a shell script.... – Academician