第一种办法:

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编译器是不认识这种格式的。


GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐