Reputation: 555
In C++, I am trying to declare an unordered_set
simply like this:
std::unordered_set<int> k;
But it is showing this error:
error: 'unordered_set' is not a member of 'std'
I am using g++ (GCC) 5.3.0 on windows using MinGW. Here are the things that I have already considered:
#include <unordered_set>
-std=gnu++11
. (This is not generating any executable or error, not sure if it doing anything or not)How to fix it and compile my code successfully?
Upvotes: 4
Views: 11694
Reputation: 1052
Use -std=c++11
switch and specify output file.
g++ -std=c++11 your_file.cpp -o your_program
Upvotes: 9