Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I had installed the Ubuntu flavour of the Linux operating system. I had opened a terminal and just wrote a sample C program to check if it is compiling. When I saved the sample file and compiled with cc a.c, errors comes that the standard library is not loaded (i.e stdio.h). When I went to help pages, it says that the C or C++ compiler doesnt gets loaded by default and we should do it ourselves.

So can anyone help me out to fix this problem, i.e to load the C/C++ compiler.

share|improve this question

migrated from Jul 20 '09 at 17:15

This question came from our site for professional and enthusiast programmers.

Sounds like a question for Super User. – Sampson Jul 20 '09 at 17:14
stdio.h is not a library, if you get compilation errors please post them as well as the code so we can help you. – Fredrik Jul 20 '09 at 17:14
might I suggest (as I don't have high enough rep) the question being renamed to a question? I like this question as it's nice to see beginner stuff on these sites, so I'm not complaining, I just can't edit it myself. – codeLes Jul 20 '09 at 19:17
$ sudo apt-get install build-essential
share|improve this answer
The package build-essentials contains all the standard libraries and include files needed for compiling c programs. – txwikinger Jul 20 '09 at 17:39
The meta-package is named build-essential, not build-essentials – ephemient Jul 20 '09 at 19:53
sudo apt-get install build-essential

will install GNU Make, GCC, the development headers for Glibc or EGLIBC, and basic Debian package creation infrastructure.

For man pages, you will want to install the additional packages

sudo apt-get install manpages-dev manpages-posix-dev glibc-doc

Most libraries are split up into libfoo0, libfoo-dev, and libfoo-doc packages. (The numeric suffix on the first package may change for each ABI revision.) In order to use the library, you need libfoo0; in order to build binaries using the library, you will need libfoo-dev, and the purpose of libfoo-doc should be pretty obvious.

share|improve this answer

You need to add this to the beginning of your a.c file:

#include <stdio.h>
share|improve this answer

You must log in to answer this question.