title: C: linker command failed with exit code 1
body: <p>I'm having a problem when I compile my code. I'm not getting any error messages. However, I am getting the following message:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "_lookup", referenced from:
        _main in sixteen2-85c27c.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I have never encountered anything like this before, and most of the info I can find online involves Objective-C, not plain C. I would appreciate any help.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main (int argc, char *argv[]) {
      struct entry {
          char word[15];
          char definition[100];
      };
  
      const struct entry dictionary[100] = 
      {{"aardvark", "a burrowing African mammal"},
      {"abyss", "a bottomless pit"},
      {"acumen", "mentally sharp; keen"},
      {"addle", "to become confused"},
      {"aerie", "a high nest"},
      {"affix", "to append; attach"},
      {"agar", "a jelly made from seaweed"},
      {"ahoy", "a nautical call of greeting"},
      {"aigrette", "an ornamental cluster of feathers"},
      {"ajar", "partially opened"}};
  
      int entries = 10;
      int entryNumber;
      int lookup (const struct entry dictionary[], const char search[], const int entries);
  
      if (argc != 2)
      {
          fprintf (stderr, "No word typed on the command line.\n");
          return EXIT_FAILURE;
      }
  
      entryNumber = lookup (dictionary, argv[1], entries);
  
      if (entryNumber != -1)
          printf("%s\n", dictionary[entryNumber].definition);
      else
          printf("Sorry, %s is not in my dictionary.\n", argv[1]);
  
      return EXIT_SUCCESS;
  }
  </code></pre>