0

Here is my 'program':

#include <string>
#include <ext/hash_map>

int main()
{
    std::hash_map<std::string, int>  myMap;
}

I'm trying to compile it with g++ on Red Hat. Can someone explain why does the compiler complain:

error: 'hash_map' is not a member of 'std'

Subway
  • 5,286
  • 11
  • 48
  • 59

1 Answers1

1

The hash_map in is in a different namespace, namely __gnu_cxx::hash_map. More recent versions of hash maps are std::tr1::unordered_map or since c++11 std::unordered_map

b.buchhold
  • 3,837
  • 2
  • 24
  • 33