468,484 Members | 2,114 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,484 developers. It's quick & easy.

Compilation error in converting hash_set from SGI STL to VS8 2005 STL

Hi,

I have an application that defines a hash_set as:
typedef hash_set<const char*, hash<const char*>, chunker_eqstr> StringSet;

This code compiles OK with VS6 and SGI STL library. It is patterned after the SGI STL documentations.
We are now moving to VS 2005 and the SGI STL header file is in conflict with the VS 2005 system header files.
But when I try to use VS 2005 and the VS8 STL library instead of SGI STL, I got these error messages:

" headerfile.h(71) : error C2065: 'hash' : undeclared identifier
headerfile.h(71) : error C2059: syntax error : 'const'
headerfile.h(71) : error C2947: expecting '>' to terminate template-argument-list, found '>"

It seems that the 'hash' function is a defined function in SGI STL but not in VS8 2005 STL.
Am I missing something? What is wrong with this typedef?
Thanks for any help.

Misu
Nov 19 '07 #1
3 3130
weaknessforcats
9,207 Expert Mod 8TB
Are you using namespace stdext?

The hash templates are not ANSI standard.
Nov 20 '07 #2
Are you using namespace stdext?

The hash templates are not ANSI standard.
This is part of the front matter in the header file:

#include <xhash>
#include <hash_set>
#include <hash_map>

using namespace std;
using namespace stdext;

Thanks,
Misu
Nov 20 '07 #3
weaknessforcats
9,207 Expert Mod 8TB
It seems there is no template named hash.

It has to be hash_map or hash_multimap, or some such.

Since these are all non-standard templates, I would expect incompatibilities.

Does your SGI STL work with Visual Studio.NET 2005??

I mean, can you not just use those templates and not use the stdext namespace??
Nov 20 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Abhijit Ray | last post: by
10 posts views Thread by Alex Gerdemann | last post: by
5 posts views Thread by Bart Blommerde | last post: by
3 posts views Thread by Markus Dehmann | last post: by
1 post views Thread by zs | last post: by
2 posts views Thread by breck | last post: by
8 posts views Thread by Rakesh | last post: by
5 posts views Thread by Amit Bhatia | last post: by
5 posts views Thread by Markus Dehmann | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by gieforce | last post: by
reply views Thread by theflame83 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.