I try to compile it with: "cc hello.c" and got this error:
arya@arya-computer:~/Desktop$ cc hello.c
hello.c:1:20: 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'
hello.c:4: warning: return type of �main' is not �int'
Why isn't this working is it because I'm using Ubuntu instead of FreeBSD?
arya@arya-computer:~/Desktop$ cc hello.c
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'
The return type of main should be int, not void. The code below compiled & ran fine on my computer. Does Ubuntu use gcc? ( If so, your version of 'cc' is possibly a link to 'gcc'. ) I'm using gcc and it worked.
#include <stdio.h>
int main()
{
printf("\nHello World\n");
}
same thing when I use gcc, do you think there is something wrong with the compiler? I'm sorry if this sounds stupid, but one of first lines says: hello.c:1:19: error: stdio.h: No such file or directory should there be a file called stdio.h in the same folder as my .c file is?
arya@arya-computer:~/Desktop$ gcc hello.c
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'