My Eclipse CDT indexer apparently cannot find std::unordered_map
, although the compiler does. It shows the following "errors":
The "Includes" folder of my project looks like this:
How can I tell the indexer how to find std::unordered_map
?
My Eclipse CDT indexer apparently cannot find std::unordered_map
, although the compiler does. It shows the following "errors":
The "Includes" folder of my project looks like this:
How can I tell the indexer how to find std::unordered_map
?
For a solution to the indexer-C++11-problem in general, see the answer to this question: Eclipse CDT indexer does not know C++11 containers
unordered_map is under tr1 namespace of std.
So you have to add this inclusion:
#include <tr1/unordered_map>
and then you can declare your variable in main in this way:
std::tr1::unordered_map<int,int> mapArray[10];
I am using Eclipse Juno CDT and gcc4.7 on Ubuntu 12.10 and have std=c++11 defined. Still indexer was going nuts about unordered_map. Adding TR1 resolved the issue.