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

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

问题描述

我正在尝试在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可执行文件.我也为其他几个可执行文件(屏幕,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复制)上的file命令输出:

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 executable | 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:未找到"是什么意思?意思是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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