title: ESP8266 for Arduino IDE (xtensa-lx106-elf-gcc) and std::map linking error
body: <p>Is it possible at all to use map with ESP8266 for Arduino package?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;map&gt;
  
  typedef std::map&lt;int, int&gt; Items;
  
  void setup() {
    Items items;
    items[2]=5;
    //items.emplace(4,5);
  }
  
  void loop() {
  
  }
  </code></pre>
  
  <p>Here is compilation/linking erorrs:</p>
  
  <pre><code>Arduino: 1.6.5 (Windows 8.1), Board: "Generic ESP8266 Module, Serial, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS)"
  
  sketch_oct31a.cpp.o: In function `loop':
  C:\Program Files (x86)\Arduino/sketch_oct31a.ino:11: undefined reference to     `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,     std::_Rb_tree_node_base*, std::_Rb_tree_node_base&amp;)'
  sketch_oct31a.cpp.o: In function `_M_emplace_hint_unique&lt;const     std::piecewise_construct_t&amp;, std::tuple&lt;int&amp;&amp;&gt;, std::tuple&lt;&gt; &gt;':
  c:\users\user\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-    elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-    elf\include\c++\4.8.2\bits/stl_tree.h:1673: undefined reference to     `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*,     std::_Rb_tree_node_base*, std::_Rb_tree_node_base&amp;)'
  sketch_oct31a.cpp.o: In function `std::_Rb_tree&lt;int, std::pair&lt;int const,     int&gt;, std::_Select1st&lt;std::pair&lt;int const, int&gt; &gt;, std::less&lt;int&gt;,     std::allocator&lt;std::pair&lt;int const, int&gt; &gt;     &gt;::_M_erase(std::_Rb_tree_node&lt;std::pair&lt;int const, int&gt; &gt;*)':
  c:\users\user\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-    elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-    elf\include\c++\4.8.2\bits/stl_tree.h:1130: undefined reference to     `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
  sketch_oct31a.cpp.o: In function `std::_Rb_tree_iterator&lt;std::pair&lt;int     const, int&gt; &gt;::operator--()':
  c:\users\user\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-    elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-    elf\include\c++\4.8.2\bits/stl_tree.h:204: undefined reference to     `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
  sketch_oct31a.cpp.o:    (.text._ZNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE29_M_get    _insert_hint_unique_posESt23_Rb_tree_const_iteratorIS2_ERS1_[_ZNSt8_Rb_treeIiSt4    pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EE29_M_get_insert_hint_unique_posESt    23_Rb_tree_const_iteratorIS2_ERS1_]+0x0): undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
  sketch_oct31a.cpp.o: In function `std::_Rb_tree&lt;int, std::pair&lt;int const,     int&gt;, std::_Select1st&lt;std::pair&lt;int const, int&gt; &gt;, std::less&lt;int&gt;,     std::allocator&lt;std::pair&lt;int const, int&gt; &gt;     &gt;::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator&lt;std::pair&lt;int     const, int&gt; &gt;, int const&amp;)':
  c:\users\user\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-    elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits/stl_tree.h:1431: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
  c:\users\user\appdata\roaming\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits/stl_tree.h:1448: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
  collect2.exe: error: ld returned 1 exit status
  Error compiling.
  </code></pre>
  
  <p>I took that package from here: <a href="https://github.com/esp8266/Arduino" rel="noreferrer">https://github.com/esp8266/Arduino</a></p>
  
  <p>BTW any other stuff for ESP8266 compiles OK.</p>
  
  <p>Thanks in advance</p>