Unable to compile simple c program in Linux Mint 15
I was having the same problem, and simply installed the g++ package and that fixed the missing include file.
sudo apt-get install g++
I had this situation before:
rleclerc@fvrwbp01:~# gcc -o tokens tokens.c tokens.c:1:19: fatal error: stdio.h: No such file or directory compilation terminated.
You wrote:
sudo apt-get install build-essintial
There's a typo. Try this instead (I guess you already did something similar):
sudo apt-get install --no-install-recommends gcc
and:
sudo apt-get install --no-install-recommends build-essential
Sometimes, proof-reading makes some difference:
The following NEW packages will be installed: build-essential dpkg-dev g++ g++-4.7 libc-dev-bin libc6-dev libdpkg-perl libstdc++6-4.7-dev libtimedate-perl linux-libc-dev make (...)
This fixed the error.
The package name for the C standard library is libc6
. Its header files are in the development package: libc6-dev
. Some Linux distributions do not have the development package installed. You need to install it yourself:
sudo apt-get install libc6-dev
Why the installation of build-essentials
does not resolve the dependencies I don't know. But I think the question wasn't about the installation of build-essentials
and maybe it isn't needed at all.
References: