0

I got the error after installing November CTP in Visual Studio 2012. The error is in unordered_set.hpp of boost library. But I have not included unordered_set or initializer_list anywhere in the code. I used boost only in one file and I am sure it's not the reason.

error in unordered_set.hpp:

#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
#include <initializer_list>  //error C1083: Cannot open include file: 'initializer_list': No such file or directory d:\boost\unordered\unordered_set.hpp
#endif

EDIT:

I uninstalled November CTP after, but still got the same error.

stackunderflow
  • 877
  • 4
  • 13
  • 28
  • use "show includes" option to see what happens – Balog Pal Jun 25 '13 at 09:09
  • possible duplicate of [Where is \_CPPLIB\_VER defined and is it modifiable in visual studio](http://stackoverflow.com/questions/17296629/where-is-cpplib-ver-defined-and-is-it-modifiable-in-visual-studio) – stackunderflow Jun 26 '13 at 01:35

2 Answers2

1

C++11 is enabled by default in VS2012. From boost headers

#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
#include <initializer_list>
#endif

You may try to define BOOST_NO_0X_HDR_INITIALIZER_LIST, or find initializer_list header location.

// config/suffix.hpp
#if defined(BOOST_NO_INITIALIZER_LISTS) && !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
#endif

// config/compilers/visualc.hpp
#if _MSC_VER <= 1500  || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
#  define BOOST_NO_INITIALIZER_LISTS
#endif

BOOST_STRICT_CONFIG may be commented in config/user.hpp.

However, it looks like you have no modern Visual C++ headers, that is strange since you have VS2012 (initializer_list header will be added in VS2010 actually).

ForEveR
  • 55,233
  • 2
  • 119
  • 133
0

Today had the same issue, I found that installing the November CTP is not enough, you need to change the platform toolset under project configuration to Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012) to actually use the new features, hope this helps anyone.

Rudolfs Bundulis
  • 11,636
  • 6
  • 33
  • 71