Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1975106
  • 博文数量: 356
  • 博客积分: 8284
  • 博客等级: 中将
  • 技术积分: 4580
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-15 20:25
个人简介

天行健,君子以自强不息

文章分类

全部博文(356)

文章存档

2018年(1)

2016年(4)

2015年(13)

2014年(14)

2013年(2)

2012年(25)

2011年(43)

2010年(65)

2009年(189)

分类: LINUX

2009-11-01 20:21:09

查看文章
 
开发板-/bin/sh: ./hello: not found
2009-10-22 15:49

Build Options->

Build BusyBox as a static binary (no shared libs)

Build with Large File Support (for accessing file>2GB)

如果选择 Build BusyBox as a static binary (no shared libs) 方式进行编译时,所需的库已经与程序静态地链接在一起,这些程序不需要额外的库就可以单独运行,但是自己编写的程序在文件系统上运行必须采用静态编译,否则会报诸如:bin/sh: hello :not found的错误。

静态编译如:

arm-linux-gcc –static hello.c –o hello

在开发板上直接./hello,便会有你要的惊喜~~~

转自:%B9%C2%D3%B0%C6%AE%C1%E3xx/blog/item/839f018133db12dd9023d9b4.html

静态编译,就是将动态链接库(.so)中的相关部分提取出来,链接到可执行文件中去,使可执行文件在运行的时候不依赖于动态库。

阅读(1857) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~