title: Makefile include header
body: <p>I am new to Linux programming I tried to compile a simple test construction. But I'm getting an error when compiling. Adding inc.c as well (in the app: line) doesn't work. How should I include the file correct?</p>
  
  <p>Makefile:</p>
  
  <pre><code>app: main.c inc.h
      cc -o app main.c
  </code></pre>
  
  <p>Terminal:</p>
  
  <pre><code>make
  cc -o app main.c
  /tmp/ccGgdRNy.o: In function `main':
  main.c:(.text+0x14): undefined reference to `test'
  collect2: error: ld returned 1 exit status
  make: *** [app] Error 1
  </code></pre>
  
  <p>main.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "inc.h"
  
  int main()
  {
      printf("Kijken of deze **** werkt:\n");
      test();
  
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>inc.h</p>
  
  <pre><code>#ifndef INCLUDE_H
  
  #define INCLUDE_H
  
  void test();
  
  #endif
  </code></pre>
  
  <p>inc.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void test()
  {
      printf("Blijkbaar wel!");
  }
  </code></pre>