error while loading shared libraries: libgsl.so.0:

2019-04-19 03:20发布

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?

标签: c++ gsl
8条回答
你好瞎i
2楼-- · 2019-04-19 03:50
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/shg047/software/gsl/lib/

such as: to-mr: error while loading shared libraries: libgsl.so.19: cannot open shared object file: No such file or directory

查看更多
小情绪 Triste *
3楼-- · 2019-04-19 03:52

In my experience, fastStructure depends on gsl 1.6 but not the latest version.

wget http://gnu.mirror.vexxhost.com/gsl/gsl-1.6.tar.gz
tar -zxvf gsl-1.6.tar.gz
cd gsl-1.16
./configure
make
sudo make install

Add these lines to your .bashrc file on your home directory.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export CFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"

then, run source ~/.bashrc to set these environment variables.

It works fine when I change the version from the latest to the 1.6.

查看更多
登录 后发表回答