Opened 10 years ago

Closed 10 years ago

#7930 closed Bugs (fixed)

Error C2874 occurred at bm_traits.hpp on Visual Studio 2012

Reported by: anonymous Owned by: Marshall Clow
Milestone: To Be Determined Component: algorithm
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

When boyer_moore header is included as the following,
this error occurs on Visual Studio 2012, but it doesn't occur on Visual Studio 2005 nor Visual Studio 2010.
(I don't check on Visual Studio 2008..)

#include <boost/algorithm/searching/boyer_moore.hpp>

::boost::unordered_map in boost/tr1/unordered_map.hpp is in collision
with definition of skip_map in boost/algorithm/searching/detail/bm_traits.hpp

Detail of Compiler Error C2874 is the following.
http://msdn.microsoft.com/en-us/library/vstudio/fe499f52%28v=vs.110%29.aspx

Attachments (1)

1.patch (696 bytes ) - added by anonymous 10 years ago.
patch of boost/algorithm/searching/detail/bm_traits.hpp

Download all attachments as: .zip

Change History (5)

by anonymous, 10 years ago

Attachment: 1.patch added

patch of boost/algorithm/searching/detail/bm_traits.hpp

comment:1 by Marshall Clow, 10 years ago

I am unable to reproduce this.

Please provide more details.

Z:\boost>type 7930.cpp
#include <boost/algorithm/searching/boyer_moore.hpp>

int main ( int argc, char *argv [] ) {
        return 0;
        }

Z:\boost>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

comment:2 by anonymous, 10 years ago

I use Japanese language environment.
Sorry, the cause may be not boost/algorithm/searching/detail/bm_traits.hpp,
but boost/tr1/tr1/unordered_map.

Error log is the following.

K:\MyProjects\test_vs2010\test_boyer_moore>type main.cpp
#include <boost/tr1/tr1/unordered_map>

int main ( int argc, char *argv [] )
{
        return 0;
}

K:\MyProjects\test_vs2010\test_boyer_moore>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' の宣言を確認してください。

comment:3 by anonymous, 10 years ago

I have checked that this error don't occurs in boost_1_53_0.
Please close this ticket.

Thanks.

comment:4 by Marshall Clow, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.