Boost C++ Libraries: Ticket #7930: Error C2874 occurred at bm_traits.hpp on Visual Studio 2012 https://svn.boost.org/trac10/ticket/7930 <p> When boyer_moore header is included as the following,<br /> this error occurs on Visual Studio 2012, but it doesn't occur on Visual Studio 2005 nor Visual Studio 2010.<br /> (I don't check on Visual Studio 2008..) </p> <pre class="wiki">#include &lt;boost/algorithm/searching/boyer_moore.hpp&gt; </pre><p> ::boost::unordered_map in boost/tr1/unordered_map.hpp is in collision <br /> with definition of <strong>skip_map</strong> in boost/algorithm/searching/detail/bm_traits.hpp </p> <p> Detail of Compiler Error C2874 is the following.<br /> <a class="ext-link" href="http://msdn.microsoft.com/en-us/library/vstudio/fe499f52%28v=vs.110%29.aspx"><span class="icon">​</span>http://msdn.microsoft.com/en-us/library/vstudio/fe499f52%28v=vs.110%29.aspx</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7930 Trac 1.4.3 anonymous Sat, 26 Jan 2013 07:42:19 GMT attachment set https://svn.boost.org/trac10/ticket/7930 https://svn.boost.org/trac10/ticket/7930 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">1.patch</span> </li> </ul> <p> patch of boost/algorithm/searching/detail/bm_traits.hpp </p> Ticket Marshall Clow Sat, 26 Jan 2013 19:46:36 GMT <link>https://svn.boost.org/trac10/ticket/7930#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7930#comment:1</guid> <description> <p> I am unable to reproduce this. </p> <p> Please provide more details. </p> <pre class="wiki"> Z:\boost&gt;type 7930.cpp #include &lt;boost/algorithm/searching/boyer_moore.hpp&gt; int main ( int argc, char *argv [] ) { return 0; } Z:\boost&gt;cl -I release /EHsc 7930.cpp Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved. 7930.cpp Microsoft (R) Incremental Linker Version 11.00.50727.1 Copyright (C) Microsoft Corporation. All rights reserved. /out:7930.exe 7930.obj </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 27 Jan 2013 01:45:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7930#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7930#comment:2</guid> <description> <p> I use Japanese language environment.<br /> Sorry, the cause may be not <strong>boost/algorithm/searching/detail/bm_traits.hpp</strong>,<br /> but <strong>boost/tr1/tr1/unordered_map</strong>. </p> <p> Error log is the following. <br /> </p> <pre class="wiki">K:\MyProjects\test_vs2010\test_boyer_moore&gt;type main.cpp #include &lt;boost/tr1/tr1/unordered_map&gt; int main ( int argc, char *argv [] ) { return 0; } K:\MyProjects\test_vs2010\test_boyer_moore&gt;cl -IK:\library\Boost\boost_1_52_0 /EHsc main.cpp Microsoft(R) C/C++ Optimizing Compiler Version 17.00.51106.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp K:\library\Boost\boost_1_52_0\boost/tr1/unordered_map.hpp(25) : error C2874: using 宣言によって 'boost::unordered::unordered_map' の多重宣言が発生します。 K:\library\Boost\boost_1_52_0\boost/unordered/unordered_map.hpp(42) : 'boost::unordered::unordered_map' の宣言を確認してください。 K:\library\Boost\boost_1_52_0\boost/tr1/unordered_map.hpp(26) : error C2874: using 宣言によって 'boost::unordered::unordered_multimap' の多重宣言が発生します。 K:\library\Boost\boost_1_52_0\boost/unordered/unordered_map.hpp(525) : 'boost::unordered::unordered_multimap' の宣言を確認してください。 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 05 Feb 2013 14:25:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7930#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7930#comment:3</guid> <description> <p> I have checked that this error don't occurs in boost_1_53_0.<br /> Please close this ticket.<br /> </p> <p> Thanks. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Tue, 05 Feb 2013 14:49:23 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7930#comment:4 https://svn.boost.org/trac10/ticket/7930#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket