title: gcc undefined reference to `std::ios_base::Init::Init()'
body: <p>Write a boost test whether the installation was successful demo</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;boost/lexical_cast.hpp&gt;
  int main(){
      int a = boost::lexical_cast&lt;int&gt;("123456");
      std::cout &lt;&lt; a &lt;&lt;std::endl;
      return 0;
  }
  </code></pre>
  
  <p>Compile error</p>
  
  <pre><code>test.cpp:(.text+0x24): undefined reference to `std::cout'
  test.cpp:(.text+0x29): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;::operator&lt;&lt;(int)'
  test.cpp:(.text+0x31): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; std::endl&lt;char, std::char_traits&lt;char&gt; &gt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;)'
  test.cpp:(.text+0x39): undefined reference to `std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;::operator&lt;&lt;(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; (*)(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;))'
  /tmp/ccG8Wb2k.o: In function `__static_initialization_and_destruction_0(int, int)':
  test.cpp:(.text+0x61): undefined reference to `std::ios_base::Init::Init()'
  test.cpp:(.text+0x66): undefined reference to `std::ios_base::Init::~Init()'
  /tmp/ccG8Wb2k.o: In function `std::exception::exception()':
  </code></pre>