title: statically linked libraries on mac
body: <p>I just don't understand.</p>
  
  <p>I'm to believe that gcc automatically links libc.a when invoking the gcc driver.</p>
  
  <p>However, out of curiosity I wanted to link libc.a statically using <code>-static</code>, but I get;</p>
  
  <pre><code>ld: library not found for -lcrt0.o
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I just don't understand? Also, whats <code>crt0</code>?</p>
  
  <p>I've also read posts saying to <strong>never</strong> statically link libc.a ; why? From what I've read (admittedly I'm just an undergrad), I don't see the drawbacks in linking statically..</p>
  
  <p>I read <a href="https://stackoverflow.com/questions/844819/how-to-static-link-on-os-x">this</a> post which told me to add <code>-lc</code> which seems to compile correctly, but is this statically linking or just adding libc.dylib ?</p>
  
  <p>Additionally, anytime I use <code>-static</code> flag, I get the same error returned from <code>ld</code>. I don't understand? The text I'm working through shows examples using a Unix environment, and since OS X is Unix-based, why am I having so many difficulties with my Mac? </p>
  
  <p>Thanks, Zak</p>