title: Permission Denied error when trying to compile hello world C program in Mac terminal
body: <p>I'm trying to compile a hello world c program in the mac terminal and I am generating these errors:</p>
  
  <pre><code>mysource.c:1:19: error: /usr/local/include/stdio.h: Permission denied
  mysource.c: In function ‘main’:
  mysource.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
  </code></pre>
  
  <p>This is what I typed into the terminal (mysource is the name of the .c file):</p>
  
  <pre><code>MacBook-Pro:~ drummer0014$ gcc mysource.c -o mysource
  </code></pre>
  
  <p>I had xcode 3 installed and generated the same error so I just installed xcode 4.2 today and am having the same error. I am on a macbook running snow leopard. 
  I also tried typing gcc and then dragging the file into the terminal so that it would have the full path but I get the same error. Any help would be greatly appreciated. </p>
  
  <p>When I typed gcc --verbose mysource.c -o mysource
  Here is what I received:</p>
  
  <pre><code>    Using built-in specs.
      Target: i686-apple-darwin10
      Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/src/configure --disable-         checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --enable-         llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~3/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/usr/include/c++/4.2.1
  Thread model: posix
      gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
       /usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/cc1 -quiet -v -imultilib    x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/ -D__DYNAMIC__ mysource.c -fPIC -quiet -dumpbase mysource.c -mmacosx-version-min=10.6.8 -m64 -mtune=core2 -auxbase mysource -version -o /var/folders/7r/7rMZhHx3F0WhnoyEK1zUgE+++TI/-Tmp-//ccaqeJkd.s
  ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../../../i686-apple-darwin10/include"
  ignoring nonexistent directory "/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/../../../../i686-apple-darwin10/include"
      #include "..." search starts here:
      #include &lt;...&gt; search starts here:
       /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include
       /usr/local/include
       /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/include
       /usr/include
       /System/Library/Frameworks (framework directory)
       /Library/Frameworks (framework directory)
      End of search list.
      GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) (i686-apple-    darwin10)
      compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00).
      GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=131072
      Compiler executable checksum: e787fa4ffdc9e78ad5e913828c220d85
      mysource.c:1:19: error: /usr/local/include/stdio.h: Permission denied
      mysource.c: In function ‘main’:
      mysource.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
  </code></pre>