tags:

views:

298

answers:

2

Hi all, Recently i had installed the UBUNTU flavour of the Linux operating system.I had opened a terminal and just wrote a sample C programm 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 ousrelves.So Can anyone help me out to fix this problem,i.e to load the C/C++ compiler.

Thanks and regards GNR

+5  A: 

I think you mean the compiler is not installed by default.

You probably need to open a terminal, and write:

sudo apt-get install build-essential

Afterwards, you can compile your program by running the following in the folder where your C file is (assuming it is called test.c):

gcc test.c -a test

And run it with:

./test

Also, make sure you have included the correct libraries.

Sinan Taifour
A shame they migrated it to superuser.com, it is still in private beta so I doubt he will get any other responses... +1 for giving him this.
Fredrik
Hi Sinan i had juyst tried the above command and now its coming as the Build-essential ackage is not found.Any inputs from anyone regarding this??
Try to run `sudo apt-get update` first.
Sinan Taifour
ok sure Sinan.I would really need ur help if i m stuck up againThanks a lot again
Sinan,all the efforts turns out to be in vain.Guess i need some serious help
Try to divide your problem into small sub-problems, and post a question for each of them. You'll get more exposure to people who can help you this way.
Sinan Taifour
A: 

gcc is the GNU C compiler, and is the compiler most people use when they compile c on a linux system.

if you need help understanding its options type in man gcc in the terminal. gdb is the debugger that goes along with gcc, but I would recommend downloading a graphical version of it.

Javed Ahamed