error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory

Abdolvahed picture Abdolvahed · Mar 6, 2014 · Viewed 41.4k times · Source

I use gsl. After I compiled my .cpp file and run it, I faced with below error:

error while loading shared libraries: libgsl.so.0: cannot open shared object file: No such file or directory

I found same as this problem in: https://groups.google.com/forum/#!topic/cortex_var/6vluX7pP0Sk & Linux error while loading shared libraries: cannot open shared object file: No such file or directory & http://www.gnu.org/software/gsl/manual/html_node/Shared-Libraries.html

And I have done as in the above links wrote but the error is still remained. Can anyone help me?

Answer

Inquisitive picture Inquisitive · Jul 26, 2014

To make it work do the following steps

Start Borne Shell

$LD_LIBRARY_PATH= path to your gsl lib folder inside the gsl installation folder
$export LD_LIBRARY_PATH

now run your executable

It should work fine.