title: GCC warning "incompatible implicit declaration of built-in function ‘printf’" under Mac OS X Snow Leopard
body: <p>After a very long time away from C programming, I've decided to try and get familiar with it again. I am trying to compile a hello.c program but am having problems. Here's the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  main()
  {
    printf("Hello\n");
  }
  </code></pre>
  
  <p>And here's the output from gcc:</p>
  
  <pre><code>$ gcc -o hello hello.c 
  hello.c:1:19: error: stdio.h: No such file or directory
  hello.c: In function ‘main’:
  hello.c:4: warning: incompatible implicit declaration of built-in function ‘printf’
  $
  </code></pre>
  
  <p>I am working on a Mac running Snow Leopard (10.6.8) and Xcode 3.2.6.</p>
  
  <p>Here's the 'gcc -v' output:</p>
  
  <pre><code>$ gcc -v
  Using built-in specs.
  Target: i686-apple-darwin10
  Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
  Thread model: posix
  gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
  $
  </code></pre>
  
  <p>gcc is not able to find stdio.h which is located in /Developer/SDKs/MacOSX10.6.sdk/usr/include. Wondering about how to set an environment variable so I don't have to specify the include path on the command line. I get another error when I specify it on the command line:</p>
  
  <pre><code>$ gcc -I/Developer/SDKs/MacOSX10.6.sdk/usr/include -o hello hello.c 
  ld: library not found for -lcrt1.10.6.o
  collect2: ld returned 1 exit status
  $
  </code></pre>
  
  <p>My LD_LIBRARY_PATH environment variable is:</p>
  
  <pre><code>$ echo $LD_LIBRARY_PATH
  /Developer/SDKs/MacOSX10.6.sdk/usr/lib
  $
  </code></pre>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks,
  Keith</p>