Re: gcc not compiling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/05, gb spam <gbofspam@xxxxxxxxx> wrote:
> On 10/31/05, Dotan Cohen <dotancohen@xxxxxxxxx> 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_for_my_digital_camera.html


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux