hash_map problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Harinezumi
    New Member
    • Feb 2008
    • 32

    hash_map problem

    Hi,

    I want to use SGI's hash_map in my code, but when compiling (with gcc 3.3.3) I get the following error:

    hash_map_test.h :3: error: syntax error before `;' token

    I reduced the code to minimum:

    [CODE=cpp]
    #include <ext/hash_map>

    std::hash_map<i nt, int> x;

    [/CODE]

    Could someone explain what the problem is and how to solve it?

    Thanks,
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    hash_map is not in the std namespace. Microsoft keeps theirs in stdex but I don't know if that is standard practice or not. Check your documentation.

    Comment

    • Harinezumi
      New Member
      • Feb 2008
      • 32

      #3
      Originally posted by weaknessforcats
      hash_map is not in the std namespace. Microsoft keeps theirs in stdex but I don't know if that is standard practice or not. Check your documentation.
      Thanks!
      I looked it up, and it turns out that hash_map is now in __gnu_cxx namespace (for gcc).

      Comment

      Working...