我交叉编译eudev的时候发现不支持C99,编译的命令和参数为:
./configure --host=arm-linux --prefix=/usb/eudev-3.2.9/build/ CC="arm-none-linux-gnueabi-gcc -" AR=arm-none-linux-gnueabi-ar --disable-blkid --disable-kmod --disable-selinux
报错为:
In file included from util.c:57:0:
util.h: In function 'delete_trailing_chars':
util.h:534:9: error: 'for' loop initial declarations are only allowed in C99 mode
for (char *p = s; *p; p++)
^
util.h:534:9: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [Makefile:527: util.lo] Error 1
make[3]: Leaving directory '/tool/usb/eudev/src/shared'
make[2]: *** [Makefile:391: all-recursive] Error 1
改了一下编译的脚本指定用-std=gnu99去编译,可能改的地方没对,还是不成功。
然后发现这样改最快捷"./configure --host=arm-linux --prefix=/tool/usb/eudev-3.2.9/build/ CC="arm-no