title: Link error in Boost program_options code on Ubuntu
body: <p>I installed boost on ubuntu 10.04 by</p>
  
  <pre><code>sudo apt-get install libboost-dev
  </code></pre>
  
  <p>I think after that I don't need to set any -I and -L flags, so I compile my code by</p>
  
  <pre><code>g++ test.cpp
  </code></pre>
  
  <p>Here is my test.cpp</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;set&gt;
  #include &lt;sstream&gt;
  
  #include &lt;boost/config.hpp&gt;
  #include &lt;boost/program_options/detail/config_file.hpp&gt;
  #include &lt;boost/program_options/parsers.hpp&gt;
  
  namespace pod = boost::program_options::detail;
  
  int main() 
  {  
      //contents
      std::stringstream s(
              "a = 1\n"
              "b = 2\n"
              "c = test option\n");
      //parameters
      std::set&lt;std::string&gt; options;
      options.insert("a");
      options.insert("b");
      options.insert("c");
  
      //parser
      for (pod::config_file_iterator i(s, options), e ; i != e; ++i)
      {
          std::cout &lt;&lt; i-&gt;value[0] &lt;&lt; std::endl;
      }
  }
  </code></pre>
  
  <p>I think things will goes well but actually there are some errors:</p>
  
  <pre><code>/tmp/ccNQEbJM.o: In function `boost::program_options::detail::basic_config_file_iterator&lt;char&gt;::basic_config_file_iterator(std::basic_istream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, std::set&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool)':
  a.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcEC1ERSiRKSt3setISsSt4lessISsESaISsEEb[boost::program_options::detail::basic_config_file_iterator&lt;char&gt;::basic_config_file_iterator(std::basic_istream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, std::set&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool)]+0x24): undefined reference to `boost::program_options::detail::common_config_file_iterator::common_config_file_iterator(std::set&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool)'
  a.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcEC1ERSiRKSt3setISsSt4lessISsESaISsEEb[boost::program_options::detail::basic_config_file_iterator&lt;char&gt;::basic_config_file_iterator(std::basic_istream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;, std::set&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt; const&amp;, bool)]+0x5f): undefined reference to `boost::program_options::detail::common_config_file_iterator::get()'
  /tmp/ccNQEbJM.o: In function `boost::eof_iterator&lt;boost::program_options::detail::common_config_file_iterator, boost::program_options::basic_option&lt;char&gt; &gt;::increment()':
  a.cpp:(.text._ZN5boost12eof_iteratorINS_15program_options6detail27common_config_file_iteratorENS1_12basic_optionIcEEE9incrementEv[boost::eof_iterator&lt;boost::program_options::detail::common_config_file_iterator, boost::program_options::basic_option&lt;char&gt; &gt;::increment()]+0x10): undefined reference to `boost::program_options::detail::common_config_file_iterator::get()'
  /tmp/ccNQEbJM.o: In function `boost::program_options::detail::basic_config_file_iterator&lt;char&gt;::getline(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;)':
  a.cpp:(.text._ZN5boost15program_options6detail26basic_config_file_iteratorIcE7getlineERSs[boost::program_options::detail::basic_config_file_iterator&lt;char&gt;::getline(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;)]+0x5b): undefined reference to `boost::program_options::to_internal(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I can't figure out where and why I went wrong.</p>