Linux error while loading shared libraries: cannot

2020-01-22 18:45发布

Program is part of the Xenomai test suite, cross-compiled from Linux PC into Linux+Xenomai ARM toolchain.

# echo $LD_LIBRARY_PATH                                                                                                                                          
/lib                                                                                                                                                             
# ls /lib                                                                                                                                                        
ld-2.3.3.so         libdl-2.3.3.so      libpthread-0.10.so                                                                                                       
ld-linux.so.2       libdl.so.2          libpthread.so.0                                                                                                          
libc-2.3.3.so       libgcc_s.so         libpthread_rt.so                                                                                                         
libc.so.6           libgcc_s.so.1       libstdc++.so.6                                                                                                           
libcrypt-2.3.3.so   libm-2.3.3.so       libstdc++.so.6.0.9                                                                                                       
libcrypt.so.1       libm.so.6                                                                                                                                    
# ./clocktest                                                                                                                                                    
./clocktest: error while loading shared libraries: libpthread_rt.so.1: cannot open shared object file: No such file or directory                                 

Edit: OK I didn't notice the .1 at the end was part of the filename. What does that mean anyway?

18条回答
Luminary・发光体
2楼-- · 2020-01-22 19:22

If you are running your application on Microsoft Windows, the path to dynamic libraries (.dll) need to be defined in the PATH environment variable.

If you are running your application on UNIX, the path to your dynamic libraries (.so) need to be defined in the LD_LIBRARY_PATH environment variable.

查看更多
The star\"
3楼-- · 2020-01-22 19:25

Try adding LD_LIBRARY_PATH, which indicates search paths, to your ~/.bashrc file

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path_to_your_library

It works!

查看更多
叼着烟拽天下
4楼-- · 2020-01-22 19:27

try installing sudo lib32z1

sudo apt-get install lib32z1

查看更多
欢心
5楼-- · 2020-01-22 19:31

All I had to do was run:

sudo apt-get install libfontconfig1

I was in the folder located at /usr/lib/x86_64-linux-gnu and it worked perfectly.

查看更多
趁早两清
6楼-- · 2020-01-22 19:31

I got this error and I think its the same reason of yours

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

Try this. Fix permissions on files:

cd /opt/Popcorn (or wherever it is) 
chmod -R 555 * (755 if not ok) 
chown -R root:root *

“sudo su” to get permissions on your filesystem.

查看更多
Ridiculous、
7楼-- · 2020-01-22 19:32

similar problem found here: https://bugzilla.redhat.com/show_bug.cgi?id=1456202 I've tried the mentioned solution and it actually works.

The solutions in the previous questions may work. But I think this is an easy way to fix it. Try to reinstall the package libwbclient in fedora:

dnf reinstall libwbclient
查看更多
登录 后发表回答