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

后端 未结 8 788
滥情空心
滥情空心 2021-02-05 07:06

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

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 07:48

    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 .

提交回复
热议问题