gcc error

软件和网站开发以及相关技术探讨
回复
dekula
帖子: 2
注册时间: 2008-02-23 22:37

gcc error

#1

帖子 dekula » 2008-02-23 22:45

我编写了个hello.c,内容如下:

#include <stdio.h>
int main(void)
{
printf("hello world\n");
return 0;
}
用一下命令编译:
gcc hello.c -o hello
出现如下错误,谁能指导下我啊?
hello.c:1:19: 错误: stdio.h:No such file or directory
hello.c: 在函数 ‘main’ 中:
hello.c:4: 警告: 隐式声明与内建函数 ‘printf’ 不兼
dekula
帖子: 2
注册时间: 2008-02-23 22:37

#2

帖子 dekula » 2008-02-23 23:40

原来是没有安装C/C++的库

sudo apt-get install build-essential

就好了。
anzi
帖子: 3
注册时间: 2008-01-19 19:44

#3

帖子 anzi » 2008-02-28 16:07

我也遇到了这个问题,不过看了此帖后解决了
谢谢楼主
回复