Professional Web Applications Themes

"stdio.h" not found - Mac Programming

Hello all. I'm a rookie as far as programming goes, and I'm trying t make a basic C program that looks like this: #include <stdio.h> int main (int argc, const char * argv[]) { int i; for (i = 0; i < 10; i++) { printf("I can count to %i\n", i); } return 0; } But when I try to compile it, it says the header file "stdio.h" can' be found. How might I remedy this - mst3kma ----------------------------------------------------------------------- Posted via http://www.codecomments.co -----------------------------------------------------------------------...

  1. #1

    Default "stdio.h" not found

    Hello all. I'm a rookie as far as programming goes, and I'm trying t
    make a basic C program that looks like this:

    #include <stdio.h>

    int main (int argc, const char * argv[])
    {
    int i;

    for (i = 0; i < 10; i++)
    {
    printf("I can count to %i\n", i);
    }

    return 0;
    }


    But when I try to compile it, it says the header file "stdio.h" can'
    be found. How might I remedy this
    -
    mst3kma
    -----------------------------------------------------------------------
    Posted via http://www.codecomments.co
    -----------------------------------------------------------------------

    mst3kman Guest

  2. #2

    Default Re: "stdio.h" not found

    In article <thenewsgroups.com>,
    codecomments.com says... 

    Assuming you're on OS X then stdio.h should be in /usr/include/ so first
    off check it's there. If it's not then reinstall the Developer stuff.
    James Guest

  3. #3

    Default Re: "stdio.h" not found

    On Thu, 22 Jul 2004, codecomments.com wrote: 

    Well, does /usr/include/stdio.h exist?

    If you don't know, open terminal and type
    ls -l /usr/include/stdio.h

    You should see something like:
    -r--r--r-- 1 root wheel 13511 13 Sep 2003 /usr/include/stdio.h

    If not, you've not installed something -- I'd suspect the developer
    tools, but it could be the BSD sdk or... I'm sure someone else on here
    knows which package installs the standard header files.

    If it does exist, there's something else wrong with your installation.
    Assuming your file is named "hello.c" try

    cc -o hello -I/usr/include hello.c

    that should produce an executable named "hello", and ./hello should
    execute it.

    If that works, someone else will have to tell you what to do next.

    joe

    Joe Guest

Similar Threads

  1. "File not found" Error Linux - cfm pages work in adminonly
    By Hunt?r in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: May 3rd, 07:50 AM
  2. Newb Questions #2: Environment Variables for CLI? (I get "command not found" errors )
    By Andreas Janssen in forum Linux Setup, Configuration & Administration
    Replies: 1
    Last Post: July 26th, 07:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139