title: What line is causing the 'operator==' error
body: <p>This program allows for a  user to add an items storage location and search for an item by name to find it later. I am getting a weird error when I try and run my code. Everything was working fine until I added in a <code>search</code> function for the vector. Any ideas on what is going wrong since I don't see a line item issue?</p>
  <p>The red section of GDB error report says this:</p>
  <pre><code>/tmp/ccngGZSU.o: In function `bool __gnu_cxx::__ops::_Iter_equals_val&lt;item const&gt;::operator()&lt;__gnu_cxx::__normal_iterator&lt;item*, std::vector&lt;item, std::allocator&lt;item&gt; &gt; &gt; &gt;(__gnu_cxx::__normal_iterator&lt;item*, std::vector&lt;item, std::allocator&lt;item&gt; &gt; &gt;)':
  main.cpp:(.text._ZN9__gnu_cxx5__ops16_Iter_equals_valIK4itemEclINS_17__normal_iteratorIPS2_St6vectorIS2_SaIS2_EEEEEEbT_[_ZN9__gnu_cxx5__ops16_Iter_equals_valIK4itemEclINS_17__normal_iteratorIPS2_St6vectorIS2_SaIS2_EEEEEEbT_]+0x2b): undefined reference to `operator==(item const&amp;, item const&amp;)'
  collect2: error: ld returned 1 exit status
  </code></pre>
  <p>The code is only 150 lines long, so 199:17 doesn't exist as far as I know.</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  
  using namespace std;
  
  struct item {
    string name;
  
    string color;
  
    string size;
  
    string location;
  };
  
  void additem()
  
  {
    int num;
  
    cout &lt;&lt; &quot;How any items do you wish to add? &quot; &lt;&lt; endl;
    cin &gt;&gt; num;
  
    vector&lt;item&gt; items(num);
  
    item hold;
  
    for (vector&lt;item&gt;::size_type i = 0; i &lt; items.size(); i++) {
      cout &lt;&lt; &quot;What is the item name? &quot; &lt;&lt; endl;
      cin &gt;&gt; hold.name;
  
      cout &lt;&lt; &quot;What is the item color? &quot; &lt;&lt; endl;
      cin &gt;&gt; hold.color;
  
      cout &lt;&lt; &quot;What is the item size? &quot; &lt;&lt; endl;
      cin &gt;&gt; hold.size;
  
      cout &lt;&lt; &quot;What is the item location? &quot; &lt;&lt; endl;
      cin &gt;&gt; hold.location;
  
      items[i] = hold;
    }
  }
  
  void search()
  
  {
    item s;
  
    typedef vector&lt;item&gt; itemsearch;
    typedef itemsearch::iterator itemiterator;
  
    itemsearch items;
  
    cout &lt;&lt; &quot;Enter the item name to search for. &quot; &lt;&lt; endl;
    cin &gt;&gt; s.name;
    cout &lt;&lt; &quot;Enter the item color to search for. &quot; &lt;&lt; endl;
    cin &gt;&gt; s.color;
    cout &lt;&lt; &quot;Enter the item size to search for. &quot; &lt;&lt; endl;
    cin &gt;&gt; s.size;
  
    itemiterator i;
    i = find(items.begin(), items.end(), s);
  
    if (i != items.end()) {
      cout &lt;&lt; &quot;Item Found!&quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;The location is . . .&quot; &lt;&lt; endl;
      cout &lt;&lt; s.location &lt;&lt; endl;
    } else {
      cout &lt;&lt; &quot;Item Not Found&quot; &lt;&lt; endl;
    }
  }
  
  void menu()
  
  {
    int menu;
  
    while (menu != 3) {
      cout &lt;&lt; &quot;Please select an option from the menu to begin.&quot; &lt;&lt; endl;
  
      cout &lt;&lt; &quot;1. Add Item/s &quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;2. Search for Item &quot; &lt;&lt; endl;
      cout &lt;&lt; &quot;3. Exit Program &quot; &lt;&lt; endl;
  
      cin &gt;&gt; menu;
  
      if (menu == 1)
  
      {
        cout &lt;&lt; &quot;You selected to add an item.&quot; &lt;&lt; endl;
        additem();
      }
  
      if (menu == 2)
  
      {
        cout &lt;&lt; &quot;You selected to search for an item.&quot; &lt;&lt; endl;
        search();
      }
  
      if (menu == 3)
  
      {
        cout &lt;&lt; &quot;Exiting Prgram.&quot; &lt;&lt; endl;
        cout &lt;&lt; &quot;. . . . .&quot; &lt;&lt; endl;
  
        exit;
      }
    }
  }
  
  int main()
  
  {
    cout &lt;&lt; &quot;Welcome to Brandon's Box&quot; &lt;&lt; endl;
    cout &lt;&lt; &quot;This program will allow you to add details about an item and where &quot;
            &quot;it is stored.&quot;
         &lt;&lt; endl;
  
    menu();
  }
  </code></pre>