title: Undefined symbols error when using a header file
body: <p>I'm getting the following error and can't for the life of me figure out what I'm doing wrong.</p>
  
  <pre><code>$ gcc main.c -o main
  
  Undefined symbols:
    "_wtf", referenced from:
        _main in ccu2Qr2V.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p><strong>main.c:</strong></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "wtf.h"
  
  main(){
      wtf();
  }
  </code></pre>
  
  <p><strong>wtf.h:</strong></p>
  
  <pre><code>void wtf();
  </code></pre>
  
  <p><strong>wtf.c:</strong></p>
  
  <pre><code>void wtf(){
      printf("I never see the light of day.");
  }
  </code></pre>
  
  <p>Now, if I include the entire function in the header file instead of just the signature, it complies fine so I know wtf.h is being included. Why doesn't the compiler see wtf.c? Or am I missing something?</p>
  
  <p>Regards.</p>