Calaf
Calaf

Reputation: 10847

Compiling C++11 code with Visual Studio 2013

Microsoft Visual Studio Community 2013, Version 12.0 Update 4, bails out on a C++11 include

#include <initializer_list>

with the error

fatal error C1083: Cannot open include file: 'initializer_list': No such file or directory

Yet the features table has this one as one of the features already in VS 2013.

Upvotes: 1

Views: 3920

Answers (2)

Drop
Drop

Reputation: 13003

If you have multiple versions of Visual Studio, or if you are opening project created in older version, check that under "Project properties -> General -> Platform toolset" "Visual studio 2013 (v120)" is specified.

That would ensure that appropriate version of a compiler and Standard library will be picked up.

Upvotes: 4

Sebastian Redl
Sebastian Redl

Reputation: 72063

The code should compile and does for me. Something about your project configuration or VS setup is broken.

Upvotes: 0

Related Questions