第一次Linux下编程的问题!

软件和网站开发以及相关技术探讨
回复
头像
wangfei
帖子: 27
注册时间: 2008-04-06 22:15
联系:

第一次Linux下编程的问题!

#1

帖子 wangfei » 2008-05-09 20:04

hello.c:3: 错误: 在调试器里重新运行此程序
hello.c:3: 错误: 在调试器里重新运行此程序
hello.c:3: 错误: 在调试器里重新运行此程序
hello.c: 在函数‘main’中:
hello.c:3: 错误: expected declaration specifiers before ‘printf’
hello.c:4: 错误: expected declaration specifiers before ‘return’
hello.c:5: 错误: 在调试器里重新运行此程序
hello.c:5: 错误: 在调试器里重新运行此程序
hello.c:5: 错误: 在调试器里重新运行此程序
hello.c:5: 错误: expected ‘{’ at end of input
wangfei@wangfei-desktop:~$
程序是照着视频教程里面写的,只用了printf函数,应该没有错,但Gcc编译时出现上诉的显示,是怎么回事阿???
头像
stlxv
论坛版主
帖子: 8275
注册时间: 2006-05-03 0:39
来自: المريخ

#2

帖子 stlxv » 2008-05-09 20:15

你给出你的具体代码和详细操作过程,大家才能知道原因
PHP是最好的语言!不服来战!
yusoul
帖子: 2
注册时间: 2008-06-30 16:12

#3

帖子 yusoul » 2008-06-30 16:14

我也遇上了,解决了
看看代码,应该是
#include <stdio.h> //#和#的差别,一个是全角一个是半角了,用#就出错了
int main()
{
printf("OK\n");
return 0;
}
回复