求救:expected identifier or ‘(’ before numeric constant

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
watson爱好者
帖子: 18
注册时间: 2012-02-26 14:05

求救:expected identifier or ‘(’ before numeric constant

#1

帖子 watson爱好者 » 2012-02-27 12:44

:em19 gcc是不是出错了
hello world文件
#include <stdio.h>

int main(void)
{
printf("Hello, world!\n");
return 0;
}

然后保存到hello.c
再gcc hello.c
结果就出现了
hello.c:30:1: 错误: expected identifier or ‘(’ before numeric constant
太奇怪了。
请帮助,谢谢
watson爱好者
帖子: 18
注册时间: 2012-02-26 14:05

Re: 求救:expected identifier or ‘(’ before numeric constant

#2

帖子 watson爱好者 » 2012-02-27 13:14

有遇到过同样问题的吗?
头像
mjp123
帖子: 702
注册时间: 2009-04-09 15:06

Re: 求救:expected identifier or ‘(’ before numeric constant

#3

帖子 mjp123 » 2012-02-27 14:42

吧你的代码复制过来。没有任何问题。
watson爱好者
帖子: 18
注册时间: 2012-02-26 14:05

Re: 求救:expected identifier or ‘(’ before numeric constant

#4

帖子 watson爱好者 » 2012-02-27 15:40

mjp123 写了:吧你的代码复制过来。没有任何问题。
难道是我的ubuntu的问题?
nopriler
帖子: 352
注册时间: 2011-01-23 15:05

Re: 求救:expected identifier or ‘(’ before numeric constant

#5

帖子 nopriler » 2012-02-27 19:29

首先,请使用code标签。

代码: 全选

#include<stdio.h>
int main(void){
	printf("Hello, world!\n");
	return 0;
}
我怀疑是stdio.h 被改动了..看一下stdio.h第30行上下的内容。
回复