第一种办法:

error: stray ‘\357’ in program

error: stray ‘\274’ in program

error: stray ‘\233’ in program

 

出现此类错误的原因,在编辑器中使用的utf-8的格式保存源代码中出现了中文的标点符号、

第二种办法:

在Linux虚拟机上开发时,遇到以下错误:

Making all in test
make[5]: Entering directory `/home/linux/software/zion/media/mux/disk/test'
powerpc-e300c3-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../../../.. -I../../../../include  -I../video/common_inc -include ../../disk.h -include ../../mux_disk.h -fno-exceptions -O2 -fno-exceptions -O2 -MT umount_test.o -MD -MP-MF .deps/umount_test.Tpo -c -o umount_test.o umount_test.c
umount_test.c:1: error: stray '\357' in program
umount_test.c:1: error: stray '\273' in program
umount_test.c:1: error: stray '\277' in program
make[5]: *** [umount_test.o] Error 1
make[5]: Leaving directory `/home/linux/software/zion/media/mux/disk/test'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/linux/software/zion/media/mux/disk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/linux/software/zion/media/mux'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/linux/software/zion/media'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/linux/software/zion'
make: *** [all] Error 2
linux@ubuntu:~/software/zion$ 

我的解决办法:

将umount_test.c由utf-8格式另存为ANSI/ASCII格式,重新编译。因为你的编译器默认将文件编码转为UTF-8格式,可winavr作为gcc编译器是不认识这种格式的。


Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐