helloworld.c文件:
#include <stdio.h>
int main()
{
printf("Hello, World!\n");
}
------------------------
makefile文件:
LD = arm-linux-ld
EXEC = helloworld
OBJS = helloworld.o
CFLAGS +=
LDFLAGS +=
all:$(EXEC)
$(EXEC):$(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS$(LDLIBS_$@))
clean:
-rm -f $(EXEC) *.elf *.gdb *.o
------------------------
编译生成helloworld ,下载到开发板
[root@FriendlyARM /mnt]# ./helloworld
-sh: ./helloworld: not found //d_? 没有所需的库文件ld-linux.so.3
[root@FriendlyARM /mnt]# chmod 777 helloworld
[root@FriendlyARM /mnt]# arm-linux-readelf -a helloworld &nb

在开发板QQ2440v3上尝试运行helloworld程序时,遇到缺少库ld-linux.so.3的错误。通过检查发现库已添加,但依然报错。最终发现是由于编译器版本不匹配导致的Segmentation fault,将编译器从arm-linux-gcc-4.3.2更换为与开发板内核匹配的arm-linux-gcc-3.4.1,成功运行程序并输出'hello, FriendlyARM!'。"
88387735,2116267,使用mysql-tester快速创建千万级电商测试数据库,"['mysql生成测试数据库', '数据库压力测试', '模拟电商数据库']
最低0.47元/天 解锁文章
589

被折叠的 条评论
为什么被折叠?



