我是 Linux Mint 15 用户。
我想用 C 编写简单的程序。
下面是我的代码。(hw.c)
#include<stdio.h>
#include<conio.h>
int main()
{
printf("Hello World");
}
但是,当我尝试用 gcc 编译它时
gcc -o hw hw.c
它给了我一个错误
hw.c:1:18: fatal error: stdio.h: No such file or directory
compilation terminated.
我用谷歌搜索并找到了一些说要安装build-essential
并尝试安装它 的解决方案
sudo apt-get install build-essintial
但它又给出了一个错误。错误是
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
Depends: dpkg-dev (>= 1.13.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
那么有什么问题呢?问题是什么?
如何解决?
PS。结果locate stdio.h
是
/usr/lib/perl/5.14.2/CORE/nostdio.h
/usr/lib/syslinux/com32/include/stdio.h