title: undefined reference to `boost::filesystem::path_traits::dispatch when linking library?
body: <p>I build <code>Gource</code> project. Compile error comes when doing <code>make</code>.</p>
  <blockquote>
  <p>g++ -std=gnu++0x -Wall -Wno-sign-compare -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -g -O2 -pthread -pthread   -o gource src/gource-action.o src/gource-bloom.o src/gource-caption.o src/core/gource-conffile.o src/core/gource-display.o src/core/gource-frustum.o src/core/gource-fxfont.o src/core/gource-logger.o src/core/gource-mousecursor.o src/core/gource-plane.o src/core/gource-ppm.o src/core/gource-quadtree.o src/core/gource-regex.o src/core/gource-resource.o src/core/gource-sdlapp.o src/core/gource-seeklog.o src/core/gource-settings.o src/core/gource-shader.o src/core/gource-shader_common.o src/core/gource-stringhash.o src/core/gource-texture.o src/core/gource-png_writer.o src/core/gource-timezone.o src/core/gource-vbo.o src/core/gource-vectors.o src/gource-dirnode.o src/gource-file.o src/formats/gource-apache.o src/formats/gource-bzr.o src/formats/gource-commitlog.o src/formats/gource-custom.o src/formats/gource-cvs-exp.o src/formats/gource-cvs2cl.o src/formats/gource-git.o src/formats/gource-gitraw.o src/formats/gource-hg.o src/formats/gource-svn.o src/gource-gource.o src/gource-gource_shell.o src/gource-gource_settings.o src/gource-key.o src/gource-logmill.o src/gource-main.o src/gource-pawn.o src/gource-slider.o src/gource-spline.o src/gource-textbox.o src/gource-user.o src/gource-zoomcamera.o src/tinyxml/gource-tinyxmlerror.o src/tinyxml/gource-tinystr.o src/tinyxml/gource-tinyxml.o src/tinyxml/gource-tinyxmlparser.o  -lGL  -lGLU -lfreetype   -lpcre   -lGLEW -lGLU -lGL   -lSDL2_image -lSDL2   -lpng15   -lboost_system -lboost_filesystem
  src/gource-gource_settings.o: In function <code>boost::filesystem::path::path&lt;boost::filesystem::directory_entry&gt;(boost::filesystem::directory_entry const&amp;, boost::enable_if&lt;boost::filesystem::path_traits::is_pathable&lt;boost::decay&lt;boost::filesystem::directory_entry&gt;::type&gt;, void&gt;::type*)': /usr/include/boost/filesystem/path.hpp:139: undefined reference to </code>boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&amp;, std::__cxx11::basic_string&lt;char, std::char_traits, std::allocator &gt;&amp;, std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;)'
  collect2: error: ld returned 1 exit status</p>
  </blockquote>
  <p>Build enviroment use libboost_filesystem.so.1.53.0.</p>
  <pre><code>⋊&gt; /h/m/Gource on master ◦  ll /usr/lib64/libboost_filesystem.so                                                                                                                                                                                        18:26:31
  lrwxrwxrwx. 1 root root 29 Sep 27  2020 /usr/lib64/libboost_filesystem.so -&gt; libboost_filesystem.so.1.53.0*
  </code></pre>
  <p>I use <code>strings</code> to dig <code>libboost_filesystem.so.1.53.0</code> and find symbol like <code>boost::filesystem::path_traits::dispatch</code>.</p>
  <pre><code>⋊&gt; /h/m/Gource on master ◦  strings /usr/lib64/libboost_filesystem-mt.so | grep path_traits                                                                                                                                                             18:29:50
  _ZN5boost10filesystem11path_traits8dispatchERKNS0_15directory_entryERSsRKSt7codecvtIwc11__mbstate_tE
  _ZN5boost10filesystem11path_traits7convertEPKcS3_RSbIwSt11char_traitsIwESaIwEERKSt7codecvtIwc11__mbstate_tE
  _ZN5boost10filesystem11path_traits7convertEPKwS3_RSsRKSt7codecvtIwc11__mbstate_tE
  </code></pre>
  <p>find symbol:</p>
  <pre><code>&gt; ⋊&gt; /h/m/Gource on master ◦ nm -DC /usr/lib64/libboost_filesystem.so | grep dispatch
  0000000000007800 T boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&amp;, std::string&amp;, std::codecvt&lt;wchar_t, char, __mbstate_t&gt; const&amp;)
  </code></pre>
  <p>Library shows like this:</p>
  <pre><code>⋊&gt; /h/m/Gource on master ◦  ls /usr/lib64/libboost_filesystem.so* -l                                                                                                                                                                                    19:22:03
  lrwxrwxrwx. 1 root root     29 Sep 27  2020 /usr/lib64/libboost_filesystem.so -&gt; libboost_filesystem.so.1.53.0*
  -rwxr-xr-x. 1 root root  94760 Apr  1  2020 /usr/lib64/libboost_filesystem.so.1.53.0*
  -rwxr-xr-x. 1 root root 103592 Apr 24  2019 /usr/lib64/libboost_filesystem.so.1.69.0*
  </code></pre>
  <p>What's this compile error meaning? Thanks in advance.</p>