stray '\239' in program and Error: bad instruction `.text'

来源:互联网 发布:js resize事件 编辑:程序博客网 时间:2024/06/09 15:02

当在linux操作系统下,进行make的时候,出现如下错误

root@ubuntu:/g/s3c2440_linux_noOS_code/key_led# make
arm-linux-gcc-3.4.5 -g -c -o crt0.o crt0.s
crt0.s: Assembler messages:
crt0.s:1: Error: bad instruction `.text'
make: *** [key_led.bin] Error 1

或者是

 

root@ubuntu:/g/s3c2440_linux_noOS_code/key_led# make
arm-linux-gcc-3.4.5 -g -c -o crt0.o crt0.s
arm-linux-gcc-3.4.5 -g -c -o key_led.o key_led.c
key_led.c:1: error: stray '\239' in program
key_led.c:1: error: stray '\187' in program
key_led.c:1: error: stray '\191' in program
make: *** [key_led.bin] Error 1

真是的原因是 代码是在windows 下写的,保存的一些格式和linux下有冲突,

解决方法:在windows下,保存.c,.S  等源代码时,选择ANSI 格式