I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
So I googled for "1:20: error: stdio.h: No such file or directory" and found a post that suggests that the answer to the problem is found in the gcc manual. So I started reading it, but it is long and I'm not finding anything!
I think that I'm missing a library stdio.h but I don't know where to find it, and where to put it once I do find it. Or am I completly wrong? The error message is pretty clear.
Dotan Cohen http://technology-sleuth.com/question/how_can_i_be_safe_online.html
On Mon, Oct 31, 2005 at 09:03:14PM +0200, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h>
^-- extra space needs to be removed.
On 10/31/05, Dotan Cohen dotancohen@gmail.com wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
you have a space between "<" and "stdio" which shouldn't be there. it should just read #include <stdio.h>
i.e., the file it can't find it " stdio.h"
On 10/31/05, gb spam gbofspam@gmail.com wrote:
On 10/31/05, Dotan Cohen dotancohen@gmail.com wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
you have a space between "<" and "stdio" which shouldn't be there. it should just read #include <stdio.h>
i.e., the file it can't find it " stdio.h"
Thanks, I removed the space. I also changed the main function from void to int, and returned 0 at the end, as Brian D. McGrew suggested. It works now. In five minutes I got three helpful answers- you guys are great! Thanks everybody!
Dotan http://technology-sleuth.com/technical_answer/how_much_memory_will_i_need_fo...
hi
if you remove the blank between "<" and "stdio.h>" it will compile.
regards, vassilios
On Mon, 2005-10-31 at 21:03 +0200, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
On Mon, 2005-10-31 at 21:03 +0200, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Doltan,
I see long discussions about stuff. In case no one has actually answered your question, the problem is you have a space between "<" and "stdio.h" and so the compiler is looking for a while with an embedded space in it.
Get rid of that space and your program should compile (though you'll get some of the same warnings).
On 11/1/05, A.G. prothonotar@tarnation.dyndns.org wrote:
On Mon, 2005-10-31 at 21:03 +0200, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h> void main () { printf("\nHello World!\n"); }
Doltan,
I see long discussions about stuff. In case no one has actually answered your question, the problem is you have a space between "<" and "stdio.h" and so the compiler is looking for a while with an embedded space in it.
Get rid of that space and your program should compile (though you'll get some of the same warnings).
Thanks, actually, it was answered several times! I removed the space and made some other changes that were suggested here, and it compiled.
I also enjoyed the discussion regarding int vs. void and properly returning a 0 after the function ends. I should get to class a little more prepared than the next guy! Thank you all!
Dotan http://english-lyrics.com/el/band.php/377/Nine%20Inch%20Nails
On Monday 31 October 2005 14:03, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h>
Well, for starters, it probably doesn't like the space between the < and the s in < stdio.h> Thats what is occasionally known as typu :-)
void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
So I googled for "1:20: error: stdio.h: No such file or directory" and found a post that suggests that the answer to the problem is found in the gcc manual. So I started reading it, but it is long and I'm not finding anything!
I think that I'm missing a library stdio.h but I don't know where to find it, and where to put it once I do find it. Or am I completly wrong? The error message is pretty clear.
Dotan Cohen http://technology-sleuth.com/question/how_can_i_be_safe_online.html
Gene Heskett wrote:
On Monday 31 October 2005 14:03, Dotan Cohen wrote:
I'm just getting started in programming C. My first attempt: #include < stdio.h>
Well, for starters, it probably doesn't like the space between the < and the s in < stdio.h> Thats what is occasionally known as typu :-)
'C' being a strongly typo'd language....
void main () { printf("\nHello World!\n"); }
Threw this error: [dotancohen@localhost ~]$ gcc hello.c hello.c:1:20: error: stdio.h: No such file or directory hello.c: In function 'main': hello.c:3: warning: incompatible implicit declaration of built-in function 'printf' hello.c:2: warning: return type of 'main' is not 'int' hello.c:4:2: warning: no newline at end of file
So I googled for "1:20: error: stdio.h: No such file or directory" and found a post that suggests that the answer to the problem is found in the gcc manual. So I started reading it, but it is long and I'm not finding anything!
I think that I'm missing a library stdio.h but I don't know where to find it, and where to put it once I do find it. Or am I completly wrong? The error message is pretty clear.
Dotan Cohen http://technology-sleuth.com/question/how_can_i_be_safe_online.html