user0182
October 5th, 2007, 11:54 PM
Hi All,
I have just install Ubuntu, and when I try to compile a simple C program using gcc, I get the following error.
gcc <sourcefile.c> -o <outputfile.exe>
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
I am assuming that I do not have the C libraries, installed. I have tried the following commands:
sudo apt-get install build-essential
sudo aptitude install build-essential
Although, in both cases the shell asks that I insert the installation CD. Which I have tried, but it doesn't seem to recognise the CD.
Could someone please tell me, what is the best way, in their opinion, to install the C libraries. Also, I want to be able to compile C++ programs, using g++, therefore could one tell me if I will need to do anything further to install g++.
Thanks in Advance
I have just install Ubuntu, and when I try to compile a simple C program using gcc, I get the following error.
gcc <sourcefile.c> -o <outputfile.exe>
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:5: warning: incompatible implicit declaration of built-in function ‘printf’
I am assuming that I do not have the C libraries, installed. I have tried the following commands:
sudo apt-get install build-essential
sudo aptitude install build-essential
Although, in both cases the shell asks that I insert the installation CD. Which I have tried, but it doesn't seem to recognise the CD.
Could someone please tell me, what is the best way, in their opinion, to install the C libraries. Also, I want to be able to compile C++ programs, using g++, therefore could one tell me if I will need to do anything further to install g++.
Thanks in Advance