我正在尝试在 linux shell 中运行可执行文件(树莓派上的 OpenELEC)
OpenELEC:~ # /storage/fingi/usr/lib/autossh/autossh
-sh: /storage/fingi/usr/lib/autossh/autossh: not found
这种情况下的“未找到”是什么意思?
如果我尝试做 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
文件类型格式正确。但它不会工作,也不会提供更多描述性错误消息。
由于 openELEC 非常严格,我从 raspbmc 安装中复制了 autossh 可执行文件。我也为其他几个可执行文件(屏幕、boost 库等)完成了它,它们工作正常。
任何人都可以提出可能是什么问题吗?
编辑 1: 正如所建议的那样,这是正在运行的可执行文件(也从 raspbmc 复制)上的文件命令的输出:
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。
字符串可执行 | less
是查看可执行文件所需的库和外部符号的最快方法。
或者
重新编译您的程序并通过指定 -static
选项使用静态链接。
关于linux - "-sh: executable_path:not found"是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21084611/