编写了个hello入门程序:
#include<stdio.h>
int main()
{
printf("hello!!!");
return 0;
}
arm-linux-gcc编译好了ftp到开发板上,出现:-sh:hello:not found
查看网上说:如果选择 Build BusyBox as a static binary (no shared libs) 方式进行编译时,所需的库已经与程序静态地链接在一起,这些程序不需要额外的库就可以单独运行,但是自己编写的程序在文件系统上运行必须采用静态编译,否则会报诸如:bin/sh: hello :not found的错误。
于是,静态编译如:
arm-linux-gcc –static hello.c –o hello
再下载到板子上出现了:Segmentation fault
请问:这是怎么回事?