Linux error while loading shared libraries: cannot open shared object file: No such file or director
程序员文章站
2024-02-21 23:17:40
...
Your library is a dynamic library. You need to tell the operating system where it can locate it at runtime.
To do so, we will need to do those easy steps:
(1 ) Find where the library is placed if you don't know it.
sudo find / -name the_name_of_the_file.so
(2) Check for the existence of the dynamic library path environment variable(LD_LIBRARY_PATH
)
$ echo $LD_LIBRARY_PATH
if there is nothing to be displayed, add a default path value (or not if you wish to)
$ LD_LIBRARY_PATH=动态库所在的path
(3) We add the desire path, export it and try the application.
Note that the path should be the directory where the path.so.something
is. So if path.so.something
is in /my_library/path.so.something
it should be :
$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
$ export LD_LIBRARY_PATH
$ ./my_app
这样的话只会在当前有效,如果重启电脑,会失效,最好的办法是写进bashrc里面
推荐阅读
-
Linux error while loading shared libraries: cannot open shared object file: No such file or director
-
error while loading shared libraries: librediscluster.so..: cannot open shared object file: No such
-
error while loading shared libraries: libfslio.so: cannot open shared object file: No such file
-
error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such
-
解决启动MongoDB错误:error while loading shared libraries: libstdc++.so.6:cannot open shared object file:
-
解决error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file
-
error while loading shared libraries: xxx: cannot open shared object file: No such file or directory
-
gmx-MMPBSA — error while loading shared libraries: libgfortran.so.3: cannot open shared object file
-
mysql初始化/usr/local/mysql/bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
-
错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory,errorwhileloading_PHP教程