RE: gcc not compiling

From: Brian D. McGrew (brian_at_visionpro.com)
Date: 10/31/05

  • Next message: Derek Martin: "Re: gcc not compiling"
    Date: Mon, 31 Oct 2005 11:05:41 -0800
    To: "For users of Fedora Core releases" <fedora-list@redhat.com>
    
    

    You've got a space in your include statement:

    #include <stdio.h>

    int
    main(int argc, char *argv[])
    {
            Printf("\nHello World!\n");
            return(0);
    }

    Never protoctype main as a void function or else you can't get a return
    value back to the operating system.

    -brian

    Brian D. McGrew { brian@visionpro.com || brian@doubledimension.com }

    --
    > Those of you who think you know it all,
      really annoy those of us who do! 
    -----Original Message-----
    From: fedora-list-bounces@redhat.com
    [mailto:fedora-list-bounces@redhat.com] On Behalf Of Dotan Cohen
    Sent: Monday, October 31, 2005 11:03 AM
    To: For users of Fedora Core releases
    Subject: gcc not compiling
    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
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
    -- 
    fedora-list mailing list
    fedora-list@redhat.com
    To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
    

  • Next message: Derek Martin: "Re: gcc not compiling"

    Relevant Pages

    • xemacs installation problems
      ... checking for gcc... ... checking whether we are using GNU C... ... checking size of int... ... configure: warning: No OffiX without generic Drag'n'Drop support ...
      (comp.os.linux.misc)
    • Re: gcc bug? Openoffice port impossibel to compile on 4.8
      ... remove this silly "bitten by the Linux bug" and the red-herring of gcc ... struct bar {int a; int b;} dapper; ... The *warning* emitted by gcc when enough analysis is done (e.g. ...
      (freebsd-hackers)
    • Re: How to check if same partition
      ... GCC will bitch when you get this wrong. ... function(int b, int c, int something) ... The gcc version I am using is clever enough not to give this warning ... I covered all cases for argc. ...
      (comp.os.linux.development.apps)
    • Help needed in solving C-errors in Linux (gcc)
      ... i'm trying to make I got the following messages from gcc. ... main.c:22: warning: comparison is always false due to limited range of data type ... int conv_inch2feet; ... int convert(int unit, const char *,const char *,const char *); ...
      (comp.os.linux.development.apps)
    • Help needed in solving C-errors in Linux (gcc)
      ... i'm trying to make I got the following messages from gcc. ... main.c:22: warning: comparison is always false due to limited range of data type ... int conv_inch2feet; ... int convert(int unit, const char *,const char *,const char *); ...
      (alt.os.linux)