C compiler not working correctly.

Asked by baseballjw

I keep trying to compile a simple program using the gcc compiler. It won't work. I specifically type in: gcc -o hello hello.c. I get an error reading:
hello.c:2:19: error: stdio.h: No such file or directory
hello.c:4:19: error: stlib.h: No such file or directory
hello.c: In function ‘main’:
hello.c:8: warning: incompatible implicit declaration of built-in function ‘printf’
This does not make any sense to me. Please help me out. Thanks for the help in advance.

James

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Randy LeJeune (lejeunerandy-fastmail) said :
#1

Do you have the "build-essential" package installed? I think it contains all of the libraries and header files you will need to compile C programs.

Revision history for this message
Bhavani Shankar (bhavi) said :
#2

Bhavani Shankar suggests this article as an answer to your question:
FAQ #61: “Packages required to compile a C program in Ubuntu”.

Can you help with this problem?

Provide an answer of your own, or ask baseballjw for more information if necessary.

To post a message you must log in.