title: undefined reference to boost::filesystem::path_traits::convert
body: <p>I am trying to compile a program using <code>cmake</code>, and am seeing the following linker error:</p>
  
  <blockquote>
    <p>/home/quant/bin/boost_1_61_0/stage/lib/libboost_log_setup.so:
    undefined reference to
    <code>boost::filesystem::path_traits::convert(wchar_t const*, wchar_t
    const*, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;,
    std::allocator&lt;char&gt; &gt;&amp;, std::codecvt&lt;wchar_t, char, __mbstate_t&gt;
    const&amp;)' /home/quant/bin/boost_1_61_0/stage/lib/libboost_log.so:
    undefined reference to
    </code>boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry
    const&amp;, std::__cxx11::basic_string,
    std::allocator >&amp;)'</p>
  </blockquote>
  
  <p>The linker command that <code>ninja</code> generated looks like this:</p>
  
  <blockquote>
    <p>g++   -pthread -DBOOST_ALL_DYN_LINK<br>
    utility/test/CMakeFiles/utilityTest.dir/loadCSVTests.cpp.o
    utility/test/CMakeFiles/utilityTest.dir/main.cpp.o
    utility/test/CMakeFiles/utilityTest.dir/randomDeviceTests.cpp.o  -o
    utility/test/utilityTest  -rdynamic
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_thread.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_program_options.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_serialization.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_unit_test_framework.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_system.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_log.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_log_setup.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_filesystem.so
    utility/lib/libutilityLib.a utility/testLib/libutilityTestLib.a
    utility/lib/libutilityLib.a
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_thread.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_program_options.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_serialization.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_unit_test_framework.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_system.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_log.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_log_setup.so
    /home/quant/bin/boost_1_61_0/stage/lib/libboost_filesystem.so
    -Wl,-rpath,/home/quant/bin/boost_1_61_0/stage/lib</p>
  </blockquote>
  
  <p>As you can see, I am linking against <code>boost_filesystem</code> and <code>boost_system</code>, so it's not the same problem as referenced on <a href="https://stackoverflow.com/questions/7972314/c-boostfilesystem-undefined-reference-to-boostfilesystem3pathroot-nam">this SO post</a> (and the many others like it).</p>
  
  <p>I am using <code>boost 1.61</code>, which I compiled with <code>gcc 5.3</code> (the same compiler as the one I'm compiling my program with).</p>
  
  <p>What am I doing wrong?</p>