[Done]plz help me with a simple gcc problem

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

[Done]plz help me with a simple gcc problem

#1

帖子 ljimmyd » 2008-08-16 8:08

i began to learn c program language last night. but when i tried this morning,a problem happened.

i wrote :

#include <stdio.h>
main()
{
printf("hello, world\n");
}

then i saved as "helloworld.c". and in terminal "cc helloworld.c"

but it appeared :

helloworld.c:1:19: error: stdio.h: No such file or directory
helloworld.c: In function ‘main’:
helloworld.c:4: warning: incompatible implicit declaration of built-in function ‘printf’


what is the problem?
上次由 ljimmyd 在 2008-08-16 8:31,总共编辑 1 次。
lemonade
帖子: 53
注册时间: 2007-09-01 7:15

#2

帖子 lemonade » 2008-08-16 8:18

要安装bulidessential,在新立得里就有。不然头文件无法使用。
头像
CLOCKWORKHEART
帖子: 635
注册时间: 2007-11-05 19:26

#3

帖子 CLOCKWORKHEART » 2008-08-16 12:45

顶楼上 :em38
头像
hellojinjie
帖子: 1150
注册时间: 2007-09-14 21:03
来自: 浙江

#4

帖子 hellojinjie » 2008-08-16 20:44

代码: 全选

sudo apt-get install build-essential
Say hello to everyday!
回复