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
You can use gsl-config --libs
in you makefile or in the command line when you link the gsl library. Just type gsl-config
you can find the options it offers to you. Choose the options you need, you will find compile and link process much easier than before. As a result, when I type gsl-config --libs
in my terminal, I get -L/usr/local/lib -lgsl -lgslcblas -lm
. Although it is very simple, first you should know where you gsl is installed. You can add the directory to the PATH
environment variable or use the absolute path to execute gsl-config
.