Archived

This topic is now archived and is closed to further replies.

rendertarget1

#Including <hash_map> where and how??

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites