title: … undefined reference to … collect2: ld returned 1 exit status
body: <p>I'm having some errors when compiling and I can't figure out why...is my heapsort.h supposed to have an exported type?</p>
  
  <p>heapsort.c    </p>
  
  <pre><code>#include &lt;stdio.h&gt;        // standard libraries already included in "list.h"
  #include &lt;stdlib.h&gt;
  
  #include "heap.h"
  #include "heapsort.h"
  
  void heapSort(int* keys, int numKeys){
     heapHndl H = NULL;
     H = buildHeap(numKeys, keys, numKeys);
     for (int i = 1; i &lt; numKeys; i++){
        keys[i] = maxValue(H);
        deleteMax(H);
     }
     freeHeap(&amp;H);
  }
  </code></pre>
  
  <hr>
  
  <p>heapsort.h:</p>
  
  <pre><code>#ifndef _HEAPSORT_H_INCLUDE_
  #define _HEAPSORT_H_INCLUDE_
  
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void heapSort(int* keys, int numKeys);
  
  #endif
  </code></pre>
  
  <hr>
  
  <p>when I go to compile with my client program I get this error upon compilation: </p>
  
  <pre><code>HeapClient.o: In function `main':
  HeapClient.c:(.text.startup+0x1a3): undefined reference to `heapsort'"
  </code></pre>