在mini2440开发板上出现-sh./hello not found错误的解决
来源:互联网 发布:山东滨州大数据产业园 编辑:程序博客网 时间:2024/05/23 00:18
这两天在mini2440开发板上通过NFS挂载根文件系统,然后将应用程序hello放到根文件系统上,通过SecureCRT调用./hello,发生了-sh./hello not found的错误。网上说出现这种错误的问题一般有两种:1、在根文件系统/lib下缺少相应的动态链接库;2、板子上的C库和编译hello.c的C库差别很大。带着这样的指导思想,我进行了下面的分析:
(1)首先在主机的hello程序目录下执行arm-linux-readelf -a hello后出现如下所示情况:
./
这说明hello程序依赖于/lib/ld-linux.so.3,在主机的/lib下查找后发现没有这个动态库,只有ld-linux.so.2;在开发板的根目录/lib下查找也没有这个库文件。至此好像能说明错误发生的原因了。那么怎么解决呢?
进一步分析,在主机下输入arm-linux-gcc -v发现我所用的交叉编译器类型为4.3.2,而在编译内核的时候我们用的是3.4.5,因此想到可能是编译器导致动态链接库里只有ld-linux.so.2,因此决定更换3.4.5的交叉编译器。具体方法网上有很多,大致就是下载相应的交叉编译器-解压-修改PATH路径-重启生效,此处略过。通过更换交叉编译器,再次编译hello.c,(arm-linux-gcc -o hello hello.c)。然后在主机的hello程序目录下执行arm-linux-readelf -a hello后出现如下所示情况:
这说明所依赖的动态链接库改变了,而这些库都有,因此将hello程序拷到开发板根文件系统上,再次执行./hello后程序正常运行。
解决方案:1、首先在hello程序目录下执行arm-linux-readelf -a hello,看hello应用程序依赖于哪些库文件;
2、在开发板/lib目录下查找是否缺少上述库文件,如果没有,将它们从主机的交叉编译器的/lib中复制到开 发板的/lib中,如果主机的编译器里面也没有这些库文件,则很可能是编译内核时的交叉编译器和编译hello时的交叉编译器不一致。此时需要更换交叉编译器,使二者一致。
- 在mini2440开发板上出现-sh./hello not found错误的解决
- 交叉编译boa后在开发板运行boa出现-/bin/sh: boa: not found 错误的解决方法
- 在目标板上移植动态库(-/bin/sh: XXX: not found 问题的解决)
- 在目标板上移植动态库(-/bin/sh: XXX: not found 问题的解决)
- 关于在开发板上运行程序显示“-bin/sh:/XXX not found”的解决方法
- 交叉编译环境以及开发板上-/bin/sh: ./hello: not found
- 交叉编译环境以及ARM开发板上-/bin/sh: ./hello: not found
- 交叉编译环境以及ARM开发板上-/bin/sh: ./hello: not found
- -bin/sh ./hello not found错误
- Ubuntu12.04下安装tslib出现./autogen.sh: 4: ./autogen.sh: autoreconf: not found的错误解决
- 我在linux主机用arm-linux-gcc编译后,复制到开发板根目录运行,出现/bin/sh: ./hello not found
- bin/sh: hello :not found 的解决方法
- 解决node-ffi在Windows XP上使用出现“Error: The specified procedure could not be found”的错误
- bin/sh: hello :not found -sh: ./hello: not found
- bin/sh: hello :not found
- 在目标板上移植动态库(-/bin/sh: XXX: not found 问题的解决)(by liukun321咕唧咕唧)
- 在嵌入式开发板上执行应用程序时出现/bin/sh: ./XXX :Permission denied 错误的解决方法
- 解决应用程序执行时出现“-/bin/sh: ./xxx: not found”
- Effective C++:条款40:明智而审慎地使用多重继承
- Selenium
- asp.net+jquery.ajax+json 不同浏览器的感悟
- loadrunner的参数只能显示100条?
- 分支-16. 计算分段函数(10)
- 在mini2440开发板上出现-sh./hello not found错误的解决
- 关于公安部要求网站做好源端口号留存的通知及解决方案
- spring源码下载地址
- UIlabel 动态调整高度(UITableView)
- viewport的使用
- Swing中的一些对话框
- Aggregation > Aggregation Concepts > Aggregation Pipeline
- android AsynTask出现java.net.UnknownHostException问题解决方案
- Nginx配置文件nginx.conf中文详解