免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3863 | 回复: 3
打印 上一主题 下一主题

ubuntu下gcc编译错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-02-25 17:02 |只看该作者 |倒序浏览
In file included from /usr/include/stdio.h:34,
                 from hello.c:2:
/usr/lib/gcc/i686-linux-gnu/4.4.5/include/stddef.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
In file included from /usr/include/stdio.h:75,
                 from hello.c:2:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before ‘size_t’
/usr/include/libio.h:364: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:373: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:495: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
In file included from hello.c:2:
/usr/include/stdio.h:316: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:322: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:334: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:341: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:383: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:385: error: format string argument not a string type
/usr/include/stdio.h:387: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:659: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:662: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:672: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:702: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
/usr/include/stdio.h:708: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:730: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:732: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite_unlocked’
hello.c: In function ‘main’:
hello.c:5: warning: missing terminating " character
hello.c:5: error: missing terminating " character
hello.c:6: error: expected expression before ‘}’ token
hello.c:6: error: expected ‘;’ before ‘}’ token
hello.c: At top level:
hello.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
root@fmh414888-virtual-machine:~# gcc -o hello hello.c
In file included from /usr/include/stdio.h:34,
                 from hello.c:2:
/usr/lib/gcc/i686-linux-gnu/4.4.5/include/stddef.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
In file included from /usr/include/stdio.h:75,
                 from hello.c:2:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before ‘size_t’
/usr/include/libio.h:364: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:373: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/libio.h:495: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
In file included from hello.c:2:
/usr/include/stdio.h:316: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:322: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:334: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:341: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:383: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:385: error: format string argument not a string type
/usr/include/stdio.h:387: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:659: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:662: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:672: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:702: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
/usr/include/stdio.h:708: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:730: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:732: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite_unlocked’
hello.c: In function ‘main’:
hello.c:5: warning: missing terminating " character
hello.c:5: error: missing terminating " character
hello.c:6: error: expected expression before ‘}’ token
hello.c:6: error: expected ‘;’ before ‘}’ token
hello.c: At top level:
hello.c:8: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token

错误原因一大堆看不懂啊

论坛徽章:
1
天蝎座
日期:2013-12-06 18:23:58
2 [报告]
发表于 2012-02-26 13:53 |只看该作者
目测少了分号之类的! 代码不明

论坛徽章:
0
3 [报告]
发表于 2012-02-27 01:05 来自手机 |只看该作者
显然环境变量没有搞好,有东西漏了

论坛徽章:
0
4 [报告]
发表于 2012-02-27 22:45 |只看该作者
应该是环境变量的问题,但不是默认就能用的吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP