Boost C++ Libraries: Ticket #8634: boost/filesystem/path.hpp is not self-sufficient https://svn.boost.org/trac10/ticket/8634 <p> The following code is compiled under VC2012: </p> <pre class="wiki">#include &lt;boost/filesystem.hpp&gt; boost::filesystem::path p("file.txt"); size_t hash = boost::filesystem::hash_value(p); </pre><p> but gives link error: </p> <pre class="wiki">error LNK2019: unresolved external symbol "void __cdecl boost::hash_combine&lt;wchar_t&gt;(unsigned int &amp;,wchar_t const &amp;)" (??$hash_combine@_W@boost@@YAXAAIAB_W@Z) referenced in function "unsigned int __cdecl boost::filesystem::hash_value(class boost::filesystem::path const &amp;)" (?hash_value@filesystem@boost@@YAIABVpath@12@@Z) </pre><p> I fixed it by replacing </p> <pre class="wiki">#include &lt;boost/functional/hash_fwd.hpp&gt; </pre><p> with </p> <pre class="wiki">#include &lt;boost/functional/hash.hpp&gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8634 Trac 1.4.3 keen.benjamin.j@… Fri, 11 Mar 2016 08:49:32 GMT <link>https://svn.boost.org/trac10/ticket/8634#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8634#comment:1</guid> <description> <p> Problem still exists on 1.60.0, gcc 5.3.0 x86_64-unknown-linux-gnu (CentOS 7) </p> <pre class="wiki">// if #include &lt;boost/functional/hash.hpp&gt; absent, link error on boost::filesystem::hash_range // if present, no problem. // #include &lt;boost/functional/hash.hpp&gt; #include &lt;boost/filesystem.hpp&gt; namespace std { template &lt;&gt; struct hash&lt;boost::filesystem::path&gt; { size_t operator()(const boost::filesystem::path&amp; p) const { return boost::filesystem::hash_value(p); } }; } </pre><p> For that matter, shouldn't the boost header put this specialization in the std:: namespace anyway? </p> </description> <category>Ticket</category> </item> </channel> </rss>