C compiler not working correctly.

Asked by baseballjw on 2008-02-22

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.


Question information

English Edit question
Ubuntu gnome-terminal Edit question
No assignee Edit question
Last query:
Last reply:

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.

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.