title: Boost.Program_options not linking correctly under Clang
body: <p>The following initial example from the <a href="http://www.boost.org/doc/libs/1_59_0/doc/html/program_options/tutorial.html#idp343085776" rel="nofollow"><strong>Boost.Program_options</strong></a> documentation </p>
  
  <pre><code>// Copyright Vladimir Prus 2002-2004.
  // Distributed under the Boost Software License, Version 1.0.
  // (See accompanying file LICENSE_1_0.txt
  // or copy at http://www.boost.org/LICENSE_1_0.txt)
  
  /* The simplest usage of the library.
   */
  
  #include &lt;boost/program_options.hpp&gt;
  namespace po = boost::program_options;
  
  #include &lt;iostream&gt;
  #include &lt;iterator&gt;
  using namespace std;
  
  int main(int ac, char* av[])
  {
      try {
  
          po::options_description desc("Allowed options");
          desc.add_options()
              ("help", "produce help message")
              ("compression", po::value&lt;double&gt;(), "set compression level")
          ;
  
          po::variables_map vm;        
          po::store(po::parse_command_line(ac, av, desc), vm);
          po::notify(vm);    
  
          if (vm.count("help")) {
              cout &lt;&lt; desc &lt;&lt; "\n";
              return 0;
          }
  
          if (vm.count("compression")) {
              cout &lt;&lt; "Compression level was set to " 
                   &lt;&lt; vm["compression"].as&lt;double&gt;() &lt;&lt; ".\n";
          } else {
              cout &lt;&lt; "Compression level was not set.\n";
          }
      }
      catch(exception&amp; e) {
          cerr &lt;&lt; "error: " &lt;&lt; e.what() &lt;&lt; "\n";
          return 1;
      }
      catch(...) {
          cerr &lt;&lt; "Exception of unknown type!\n";
      }
  
      return 0;
  }
  </code></pre>
  
  <p>compiles, links and runs correctly under g++ (<a href="http://coliru.stacked-crooked.com/a/c884fa073e00a43e" rel="nofollow"><strong>live example</strong></a>), but not under clang (<a href="http://coliru.stacked-crooked.com/a/d67ccf3be7c4a834" rel="nofollow"><strong>live example</strong></a>) with error</p>
  
  <blockquote>
    <p>/tmp/main-47ef95.o: In function
    <code>boost::program_options::typed_value&lt;double, char&gt;::name() const':
    main.cpp:(.text._ZNK5boost15program_options11typed_valueIdcE4nameEv[_ZNK5boost15program_options11typed_valueIdcE4nameEv]+0x49):
    undefined reference to</code>boost::program_options::arg'
    /tmp/main-47ef95.o: In function
    <code>boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t,
    std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;,
    std::allocator&lt;char&gt; &gt; const&amp;, std::__cxx11::basic_string&lt;char,
    std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, int)':
    main.cpp:(.text._ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i[_ZN5boost15program_options16validation_errorC2ENS1_6kind_tERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_i]+0x39):
    undefined reference to
    </code>boost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)'
    clang: error: linker command failed with exit code 1 (use -v to see
    invocation)</p>
  </blockquote>
  
  <p><strong>Question</strong>: what gives?</p>