"cannot open shared object file" 的含义

Meaning of "cannot open shared object file"

我的可执行文件可以编译,但是 运行 说他无法加载共享库。但是命名库就在那里(LD_LIBRARY_PATH 也设置在这里);两个对象都是 64b.

$ l
-rwxrwxr-x  1 dario dario  13M May  2 17:46 pose-estimator* 
-rw-rw-r--  1 dario dario  12K May  2 19:52 Makefile
-rwxr-xr-x  1 dario dario 6.0M May  2 20:06 libmyelin.so.1*

$ make                                                                      
[100%] Built target pose-estimator     

$ pwd
/home/dario/nethra-pose-estimation/build

$ echo $LD_LIBRARY_PATH
/home/dario/nethra-pose-estimation/build

$ file pose-estimator libmyelin.so.1                                   
pose-estimator: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=598251a1370ca6547010a0c5d712738b4a698e57, with debug_info, not stripped               
libmyelin.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c83470883245833a03e26dd8f1e4a23a5eb9c512, stripped                    

$ ./pose-estimator                                                                                                                                    
./pose-estimator: error while loading shared libraries: libmyelin.so.1: cannot open shared object file: No such file or directory                 

什么?

为什么动态链接器抱怨 和 "error while loading shared libraries: libmyelin.so.1: cannot open shared object file: No such file or directory"?

解决此问题的下一个调试步骤是什么?

Who is complaining with "error while loading shared libraries: libmyelin.so.1: cannot open shared object file: No such file or directory" ?

动态链接器是。

What's the next debug step to resolve this issue?

运行file pose-estimator libmyelin.so.1。可能其中一个是 64 位 (x86_64) 而另一个是 32 位 (i386)。

更新:

我的猜测有点错误:两个文件都是为 x86_64 准备的。但是这个文件

libmyelin.so.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=c83470883245833a03e26dd8f1e4a23a5eb9c512, stripped                    

有错误 (OS/ABI):ELFOSABI_SYSV 而不是(预期的)ELFOSABI_GNU。 运行time loader 忽略来自 "foreign" 操作系统的文件。

P.S。您的 pose-estimator 似乎已损坏:interpreter /lib64/l 应该是 interpreter /lib64/ld-linux-x86-64.so.2

已修复。该错误不提供任何信息。当将 LD_LIBRARY_PATH 指向 TensorRT-7.0.0.11/lib/(需要其他库)时,它会运行。

因此,如果您似乎没有任何效果(就像对我一样),请研究动态链接器抱怨的库,验证它是否是更大整体的一部分,以及要点 LD_LIBRARY_PATH到那个图书馆家族的位置。