title: C compile : collect2: error: ld returned 1 exit status
body: <p>I tried to search for that bug online but all the posts are for C++.</p>
  <p>This is the message:</p>
  <pre><code>test1.o: In function `ReadDictionary':
  /home/johnny/Desktop/haggai/test1.c:13: undefined reference to `CreateDictionary'
  collect2: error: ld returned 1 exit status
  make: *** [test1] Error 1
  </code></pre>
  <p>super simple code and can't understand what's the problem</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &quot;dict.h&quot;
  #include &quot;hash.h&quot;
  
  
  pHash ReadDictionary() {
      /* This function reads a dictionary line by line from the standard input. */
      pHash dictionary;
      char entryLine[100] = &quot;&quot;;
      char *word, *translation;
  
      dictionary = CreateDictionary();
      while (scanf(&quot;%s&quot;, entryLine) == 1) { // Not EOF
          word = strtok(entryLine, &quot;=&quot;);
          translation = strtok(NULL, &quot;=&quot;);
          AddTranslation(dictionary, word, translation);
      }
      return dictionary;
  }
  
  int main() {
      pHash dicti;
  ...
  </code></pre>
  <p>now this is the header dict.h</p>
  <pre><code>#ifndef _DICT_H_
  #define _DICT_H_
  
  #include &quot;hash.h&quot;
  
  pHash CreateDictionary();
  ...
  
  #endif
  </code></pre>
  <p>and here is the dict.c</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &quot;hash.h&quot;
  #include &quot;dict.h&quot;
  
  
  pHash CreateDectionary()
  {
      pHash newDict;
      newDict= HashCreate(650, HashWord, PrintEntry, CompareWords, GetEntryKey, DestroyEntry);
      return newDict;
  }
  </code></pre>
  <p>and if you wanna check hash.h</p>
  <pre><code>#ifndef _HASH_H_
  #define _HASH_H_
  
  //type defintions//
  typedef enum {FAIL = 0, SUCCESS} Result;
  typedef enum {SAME = 0, DIFFERENT} CompResult;
  
  typedef struct _Hash Hash, *pHash;
  
  typedef void* pElement;
  typedef void* pKey;
  
  //function types//
  typedef int (*HashFunc) (pKey key, int size);
  typedef Result (*PrintFunc) (pElement element);
  typedef CompResult (*CompareFunc) (pKey key1, pKey key2);
  typedef pKey (*GetKeyFunc) (pElement element);
  typedef void (*DestroyFunc)(pElement element);
  ...
  
  //interface functions//
  
  #endif
  </code></pre>
  <p>Maybe it will be easier if I give you the files here?</p>
  <p>Any way, I will be happy for tips on how to understand the problem</p>