#Including <hash_map> where and how??

Started by
5 comments, last by rendertarget1 20 years, 7 months ago
I''m using MS Visual Studio 6. In one of my books there''s an example that i''m working with(a workspace)that won''t compile,because it needs... #include <hash_map> I''m guessing that this is part of the Standard Template Library? and needs some setting up?..,only in the book there is no mention about any setup to compile this example(sounds familiar). At first i searched for hash_map.h and found it under C:\Dev-cpp\include\c++\mingw32\bits But it obviously needs a lot more than a few headers. Can anyone tell me how or what i do to set up with Visual Studio to be able to compile this workspace.
þ ²þ Üþ ßß þÜ Üß ßþ Üþ ß °° °Üþ °°° ° ßÜ þ [ KNOWLEDGE IS POWER] ° Ü þß °° ° Ü °° ° ²ÜÜÜÜÛÛÜÜܲÜÜÜÜÜÜÜÜÜÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜ Ü² °
Advertisement
It''s a newer component of STL than MSVC6 uses. I believe it is support in MSVC7 (.NET)

Of course you can use a diffrent version of STL than the one that ships with your compiler. I''ve heard STLPort is good. Google for it.
Thanks,although i managed to install and set up STLPort properly(as i tested it with some of their examples)the code from the book still didn't compile with msVC 6.0!

It does compile on .NET though.The silly thing about it is on the books cd,its a workspace for v6.0 not .NET.

I sometimes wonder if any of these books editor's even bother to check these things...it wouldn't have taken a few sentences to mention these facts.



[edited by - rendertarget1 on October 14, 2003 11:57:53 PM]
þ ²þ Üþ ßß þÜ Üß ßþ Üþ ß °° °Üþ °°° ° ßÜ þ [ KNOWLEDGE IS POWER] ° Ü þß °° ° Ü °° ° ²ÜÜÜÜÛÛÜÜܲÜÜÜÜÜÜÜÜÜÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜ Ü² °
hash_map worked fine for me when using VC6 + STLPort. What error do you get?
Make sure you have the latest service pack installed for msvc.

~nz

// Website // Google // GameDev // NeHe // MSDN // OpenGL Extensions //
~neoztar "Any lock can be picked with a big enough hammer"my website | opengl extensions | try here firstguru of the week | msdn library | c++ faq lite
hash_map is not a C++ standard header.

You could try just using map instead. map should work as long as the keys to the map have operator< defined on them.

-Sirp.
Battle For Wesnoth: A Free fantasy turn-based strategy game - http://www.wesnoth.org
Sirp using map instead of hash_map worked a treat.
Thanks for that

[edited by - rendertarget1 on October 15, 2003 8:04:08 PM]
þ ²þ Üþ ßß þÜ Üß ßþ Üþ ß °° °Üþ °°° ° ßÜ þ [ KNOWLEDGE IS POWER] ° Ü þß °° ° Ü °° ° ²ÜÜÜÜÛÛÜÜܲÜÜÜÜÜÜÜÜÜÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛÜÜ Ü² °

This topic is closed to new replies.

Advertisement