“-sh:executable_path:not found"是什么意思?意思是 [英] what does "-sh: executable_path:not found" mean

查看:22
本文介绍了“-sh:executable_path:not found"是什么意思?意思是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 linux shell 中运行一个可执行文件(树莓派上的 OpenELEC)

i am trying to run an executable in linux shell ( OpenELEC on raspberry pi )

OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh
-sh: /storage/fingi/usr/lib/autossh/autossh: not found

这种情况下的未找到"是什么意思?

What does the "not found" in this case mean ?

如果我尝试做 ldd:

If i try to do ldd:

OpenELEC:~ # ldd  /storage/fingi/usr/lib/autossh/autossh
/usr/bin/ldd: eval: line 1: /storage/fingi/usr/lib/autossh/autossh: not found

如果我做文件:

OpenELEC:~ # file /storage/fingi/usr/lib/autossh/autossh
/storage/fingi/usr/lib/autossh/autossh: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=599207c47d75b62ede5f214f9322ae2a18643eb7, stripped

文件类型格式正确.但它不会工作,也不会给出更多描述性错误信息.

The file type is in correct format . But it wont work adn wont give more descriptive error msg either.

由于 openELEC 非常严格,我从 raspbmc 安装中复制了 autossh 可执行文件.我也为其他几个可执行文件( screen 、boost 库等)做过这件事,它们工作得很好.

Since openELEC is very restrictive, i had copied the autossh executable from a raspbmc installation . I have done it for several other executables as well ( screen , boost libraries etc ) and they work fine .

谁能提出可能是什么问题?

Can anyone suggest what might be the issue?

正如所建议的,这是正在运行的可执行文件(也从 raspbmc 复制)上的文件命令的输出:

Edit 1: as was suggested, this is the output of file command on an executable ( also copied from raspbmc ) that is working:

OpenELEC:~ # file /storage/fingi/usr/bin/screen
/storage/fingi/usr/bin/screen: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=5c58f047a25caa2c51a81d8285b4f314abc690e7, stripped

推荐答案

这种情况下的未找到"是什么意思?

What does the "not found" in this case mean ?

这通常意味着可执行文件无法找到一个或多个(共享)库来满足其外部符号.
这通常发生在没有库存储在 initramfs 中,或者缺少可执行文件所需的共享库时.
如果可执行文件是使用与运行时库不兼容的 C 库构建的,则也可能发生这种情况,例如uClibc 与 glibc/eglibc.

This usually means that the executable cannot find one or more (shared) libraries to satisfy its external symbols.
This usually happens when no libraries are stored in the initramfs, or there is a shared library missing that the executable needs.
This can also happen if the executable is built with a C library that is incompatible with the runtime library, e.g. uClibc versus glibc/eglibc.

strings 可执行文件 |less 是查看可执行文件所需的所需库和外部符号的最快方法.

通过指定 -static 选项重新编译您的程序并使用静态链接.

strings executable | less is the quickest way to see the required libraries and external symbols that the executable requires.
Or
Recompile your program and use static linking by specifying the -static option.

这篇关于“-sh:executable_path:not found"是什么意思?意思是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆