I am trying to teach myself the C programming language from a third-party programming book, "Beginning Linux Programming."
I discovered that the C compiler was not installed on the default Kubuntu installation, so I installed it [I think!].
Now the first line of every C program that I have ever seen is this--
#include <stdio.h>
I cannot find this include file anywhere. Has it been named something else by Kubuntu? If so, why does it not adhere to the standard? Am I going to be surprised by other "include" files?
Here is the complete C program--
#include <stdio.h>
int main()
{
printf(:Hello World\n");
exit(0);
}
Here are the error messages I received when I tried to compile the "Hello World" program--
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'
hello.c:6: error: syntax error before 'exit'
hello.c.7:2: warning: no newline at end of file
If I'm going to have trouble with this simple a program, how am I going to do with more complex programs?
TIA.
I discovered that the C compiler was not installed on the default Kubuntu installation, so I installed it [I think!].
Now the first line of every C program that I have ever seen is this--
#include <stdio.h>
I cannot find this include file anywhere. Has it been named something else by Kubuntu? If so, why does it not adhere to the standard? Am I going to be surprised by other "include" files?
Here is the complete C program--
#include <stdio.h>
int main()
{
printf(:Hello World\n");
exit(0);
}
Here are the error messages I received when I tried to compile the "Hello World" program--
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'
hello.c:6: error: syntax error before 'exit'
hello.c.7:2: warning: no newline at end of file
If I'm going to have trouble with this simple a program, how am I going to do with more complex programs?
TIA.
Comment