title: C header issue: #include and "undefined reference"
body: <p>I have three files, <code>main.c</code>, <code>hello_world.c</code>, and <code>hello_world.h</code>. For whatever reason they don't seem to compile nicely, and I really just can't figure out why...</p>
  <p>Here are my source files. First hello_world.c:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &quot;hello_world.h&quot;
  
  int hello_world(void) {
    printf(&quot;Hello, Stack Overflow!\n&quot;);
    return 0;
  }
  </code></pre>
  <p>Then hello_world.h, simple:</p>
  <pre><code>int hello_world(void);
  </code></pre>
  <p>And then finally main.c:</p>
  <pre><code>#include &quot;hello_world.h&quot;
  
  int main() {
    hello_world();
    return 0;
  }
  </code></pre>
  <p>When I put it into GCC, this is what I get:</p>
  <pre>
  cc     main.c   -o main
  /tmp/ccSRLvFl.o: In function `main':
  main.c:(.text+0x5): undefined reference to `hello_world'
  collect2: ld returned 1 exit status
  make: *** [main] Error 1
  </pre>