0

I am trying to compile a code where unordered_set is used . & Visual Studio is giving me an error saying that

unordered_set is undefined

In code blocks I have seen this error with the code:

This file requires compiler and library support for the ISO C++ 2011 standard.

I have been able to configure the compiler of code blocks so that the g++ follows the C++11 ISO C++language standard & the error has gone. How can I solve this problem in Visual Studio 2015 ?

i_love_CODE
  • 43
  • 1
  • 5
  • What do you mean? Visual Studio always uses every feature it supports, you typically can't choose between different C++ version, just between different C++ support, which may or may not correspond to the official C++ versions. Also, Visual Studio doesn't use g++, so I don't understand your question – Rakete1111 Dec 28 '16 at 02:49
  • actually I was trying to compile a code where unordered_set was used . & then Visual Studio was saying that it is undefined . I copied and pasted the code in Code Blocks & found that it was showing the error above . So, I thought that Visual Studio also needed same approach I needed to solve the error in Code Blocks . I think I need to edit my questions – i_love_CODE Dec 28 '16 at 02:57
  • 1
    You probably forgot to include `` or `using namespace std;` (which you shouldn't use BTW) – Rakete1111 Dec 28 '16 at 03:03
  • WOW. It is working . I had included `` & thought that all the headers would come with it . Actually `` doesn't present in VS . I had included it from Code Blocks. you recommended not to use `using namespace std` . would you please tell me the reason ? @Rakete1111 – i_love_CODE Dec 28 '16 at 03:14
  • http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice http://stackoverflow.com/questions/31816095/why-should-i-not-include-bits-stdc-h – Danh Dec 28 '16 at 03:25
  • @i_love_CODE The reasons that are stated in the links from Danh :) – Rakete1111 Dec 28 '16 at 05:18

0 Answers0