title: linker error while linking boost log tutorial (undefined references)
body: <p>I have installed boost on Fedora 20 via yum and am trying some simple examples. However I have trouble to compile the first example from the <a href="http://boost-log.sourceforge.net/libs/log/doc/html/log/tutorial.html">logging tutorial</a>.</p>
  
  <p>Compiling with <code>g++ -c boosttest.cc</code> works fine, but I get lot's of errors when I try to link it with</p>
  
  <pre><code>g++ boosttest.o -o boosttest -lboost_log -lpthread
  </code></pre>
  
  <p>the full error-log:</p>
  
  <pre><code>boosttest.o: In function `main':
  boosttest.cc:(.text+0x44): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
  boosttest.cc:(.text+0x9a): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
  boosttest.cc:(.text+0x167): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
  boosttest.cc:(.text+0x1bd): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
  boosttest.cc:(.text+0x28a): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()'
  boosttest.o:boosttest.cc:(.text+0x2e0): more undefined references to `boost::log::v2s_mt_posix::trivial::logger::get()' follow
  boosttest.o: In function `boost::log::v2s_mt_posix::record::reset()':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix6record5resetEv[_ZN5boost3log12v2s_mt_posix6record5resetEv]+0x18): undefined reference to `boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)'
  boosttest.o: In function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger&lt;char, boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;, boost::log::v2s_mt_posix::sources::multi_thread_model&lt;boost::log::v2s_mt_posix::aux::light_rw_mutex&gt;, boost::log::v2s_mt_posix::sources::features&lt;boost::log::v2s_mt_posix::sources::severity&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;, void, void, void, void, void, void, void, void, void&gt; &gt;::open_record&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const&gt; const&amp;)':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresINS2_8severityIS6_EEvvvvvvvvvEEE11open_recordINS_9parameter3aux15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEENS1_6recordERKT_[_ZN5boost3log12v2s_mt_posix7sources22basic_composite_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEENS2_8featuresINS2_8severityIS6_EEvvvvvvvvvEEE11open_recordINS_9parameter3aux15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEENS1_6recordERKT_]+0x1e): undefined reference to `boost::log::v2s_mt_posix::core::get_logging_enabled() const'
  boosttest.o: In function `boost::log::v2s_mt_posix::aux::record_pump&lt;boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt; &gt;::~record_pump()':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED2Ev[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEED5Ev]+0x2c): undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'
  boosttest.o: In function `boost::log::v2s_mt_posix::aux::record_pump&lt;boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt; &gt;::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;&amp;, boost::log::v2s_mt_posix::record&amp;)':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEEC2ERS8_RNS1_6recordE[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEEC5ERS8_RNS1_6recordE]+0x1d): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider&lt;char&gt;::allocate_compound(boost::log::v2s_mt_posix::record&amp;)'
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEEC2ERS8_RNS1_6recordE[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEEC5ERS8_RNS1_6recordE]+0x28): undefined reference to `boost::log::v2s_mt_posix::aux::unhandled_exception_count()'
  boosttest.o: In function `boost::log::v2s_mt_posix::aux::record_pump&lt;boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt; &gt;::auto_release::~auto_release()':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEE12auto_releaseD2Ev[_ZN5boost3log12v2s_mt_posix3aux11record_pumpINS1_7sources18severity_logger_mtINS1_7trivial14severity_levelEEEE12auto_releaseD5Ev]+0xf): undefined reference to `boost::log::v2s_mt_posix::aux::stream_provider&lt;char&gt;::release_compound(boost::log::v2s_mt_posix::aux::stream_provider&lt;char&gt;::stream_compound*)'
  boosttest.o: In function `boost::log::v2s_mt_posix::sources::aux::severity_level&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;::set_value(boost::log::v2s_mt_posix::trivial::severity_level)':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix7sources3aux14severity_levelINS1_7trivial14severity_levelEE9set_valueES6_[_ZN5boost3log12v2s_mt_posix7sources3aux14severity_levelINS1_7trivial14severity_levelEE9set_valueES6_]+0x7): undefined reference to `boost::log::v2s_mt_posix::sources::aux::get_severity_level()'
  boosttest.o: In function `boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger&lt;char, boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;, boost::log::v2s_mt_posix::sources::multi_thread_model&lt;boost::log::v2s_mt_posix::aux::light_rw_mutex&gt; &gt;::open_record_unlocked&lt;boost::parameter::aux::tagged_argument&lt;boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const&gt; &gt;(boost::parameter::aux::tagged_argument&lt;boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const&gt; const&amp;)':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix7sources12basic_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEEE20open_record_unlockedINS_9parameter3aux15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEENS1_6recordERKT_[_ZN5boost3log12v2s_mt_posix7sources12basic_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEEE20open_record_unlockedINS_9parameter3aux15tagged_argumentINS1_8keywords3tag8severityEKS6_EEEENS1_6recordERKT_]+0x2a): undefined reference to `boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&amp;)'
  boosttest.o: In function `boost::log::v2s_mt_posix::sources::basic_logger&lt;char, boost::log::v2s_mt_posix::sources::severity_logger_mt&lt;boost::log::v2s_mt_posix::trivial::severity_level&gt;, boost::log::v2s_mt_posix::sources::multi_thread_model&lt;boost::log::v2s_mt_posix::aux::light_rw_mutex&gt; &gt;::push_record_unlocked(boost::rv&lt;boost::log::v2s_mt_posix::record&gt;&amp;)':
  boosttest.cc:(.text._ZN5boost3log12v2s_mt_posix7sources12basic_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEEE20push_record_unlockedERNS_2rvINS1_6recordEEE[_ZN5boost3log12v2s_mt_posix7sources12basic_loggerIcNS2_18severity_logger_mtINS1_7trivial14severity_levelEEENS2_18multi_thread_modelINS1_3aux14light_rw_mutexEEEE20push_record_unlockedERNS_2rvINS1_6recordEEE]+0x36): undefined reference to `boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&amp;)'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>What am I missing? What am I doing wrong?</p>
  
  <p><strong>EDIT 1:</strong> The order of <code>-lboost_log -lpthread</code> makes no difference in the output. There is also <a href="https://stackoverflow.com/questions/18419003/boost-log-linking-errors-under-gnu-linux">a very similar question</a>, but the solution does not work for me. The following also fails with the same errors:</p>
  
  <pre><code>g++ -DBOOST_LOG_DYN_LINK boosttest.o -o boosttest -lboost_log -lpthread
  </code></pre>