arm-elf-gcc 出错!!
各位大虾,你好!我编了一个小程序,文件名:hello.c:
#include <stdio.h>
int main(void)
{
int i;
for(i=0;i<6;i++){
printf("i=%d ",i);
printf("hello,embedded linux!\n");
}
return 0;
}
编译命令如下:
arm-elf-gcc -Wl,-elf2flt -o hello hello.c,
出现如下错误:
/usr/local/bin/arm-elf-gcc:1:Syntax error:word unexpected (expecting")")
其中arm-elf-gcc 在/usr/local/bin/目录下 用 arm-linux-gcc ,如果你是基于 linux 运行你的程序的话。 李老师怎么这么排斥arm-elf-gcc呢?
一楼的问题应该是个简单的手误吧。 斑竹怎么总这么排斥arm-elf-gcc呢?
这两个交叉编译器有什么区别吗?
上面 你在什么OS上用的?
是windows的话,就转到linux上拔
,是linux的话,就试试:chmod 744 /usr/local/bin/arm-elf-gcc 有些区别,清华 bbs 精华区里面有提到过:
there are some differences between arm-elf, arm-linux, andarm-uclinux toolch
ains.
As I know, arm-uclinux-binutils is the same as arm-linux-binutils.
arm-uclinux-gcc was patched from arm-linux-gcc to generate PIC
(Program Independent Code) code without GOT (Global Offset Table);
and arm-elf-gcc is designed for operating system independent
applications. For example, arm-elf-gcc will insert code for initializing
global C++ constructors at the beginning of main(), so even no-OS
platforms can work properly. BTW, they are almost the same while
compiling the Linux kernel.
页:
[1]