首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

stdio.h:312: error: expected declaration specifiers or解决方法

2012-02-24 
stdio.h:312: error: expected declaration specifiers or就是这样的错误:stdio.h:312: error: expected d

stdio.h:312: error: expected declaration specifiers or
就是这样的错误:
stdio.h:312: error: expected declaration specifiers or 。。。
不知道是什么问题,,在交叉编译的时候出现。。
哪位高手遇到过。。请指点。

arm-linux-gcc -o test_u ttest.c -I /opt/arm/usr/src/linux-2.6.19.2/include/linux -lusb
In file included from /usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:75,
  from ttest.c:1:
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/libio.h:332: error: expected specifier-qualifier-list before 'size_t'
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/libio.h:364: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/libio.h:373: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/libio.h:493: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_IO_sgetn'
In file included from ttest.c:1:
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:312: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:319: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:361: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:363: error: format string argument not a string type
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:361: warning: conflicting types for built-in function 'snprintf'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:365: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:367: error: format string argument not a string type
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:365: warning: conflicting types for built-in function 'vsnprintf'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:678: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:684: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:706: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread_unlocked'
/usr/local/arm/4.3.2/arm-none-linux-gnueabi/libc/usr/include/stdio.h:708: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite_unlocked'
In file included from ttest.c:2:
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:140: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__ctype_get_mb_cur_max'
In file included from /usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/types.h:133,
  from /usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:320,
  from ttest.c:2:
/opt/arm/usr/src/linux-2.6.19.2/include/linux/time.h:13: error: expected specifier-qualifier-list before 'time_t'
/opt/arm/usr/src/linux-2.6.19.2/include/linux/time.h:19: error: expected specifier-qualifier-list before 'time_t'
In file included from /usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/select.h:46,
  from /usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/sys/types.h:220,
  from /usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:320,
  from ttest.c:2:
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/bits/time.h:70: error: redefinition of 'struct timeval'
In file included from ttest.c:2:
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:337: error: expected declaration specifiers or '...' before 'size_t'


/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:367: error: expected declaration specifiers or '...' before 'size_t'
/usr/local/arm/4.3.2/bin/../arm-none-linux-gnueabi/libc/usr/include/stdlib.h:369: error: nonnull argument with out-of-range operand number (argument 1, operand 4)


[解决办法]
arm-linux-gcc -o test_u ttest.c -I /opt/arm/usr/src/linux-2.6.19.2/include/linux -lusb

-I 后面不要空格,紧跟
不知道你把内核头文件目录包进来干什么

热点排行