473,396 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 3452
weaknessforcats
9,208 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,208 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

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

Similar topics

1
by: Abhijit Ray | last post by:
I am using hash_set which is available from gcc ( and which i presume is not part of the C++ standard yet ) okay , In hash tables the key is used by a hash function to calculate a index and the...
10
by: Alex Gerdemann | last post by:
Hello, I have spent a bunch of time converting a Java program I wrote to C++ in order to improve performance, and have found that it is not necessarily faster. Specifically, I'm writing a...
5
by: Bart Blommerde | last post by:
Hi, My question is about the STL extensions hash_set and hash_map, especially the SGI versions of these templates. When defining a class like this : #include <hash_set> class MyClass : public...
3
by: Markus Dehmann | last post by:
I have a class "Data" and I store Data pointers in an STL set. But I have millions of inserts and many more lookups, and my profiler found that they cost a lot of runtime. Therefore, I want to...
1
by: zs | last post by:
Hi! I get warning message shown below in VS.NET 2k3. Is this deprecated by microsoft or by standard? I need hash_set to store and search small strings (<20 chars long). I'll have less then 300...
2
by: breck | last post by:
I'm having trouble with hash_set's insert. It's not supposed to allow the same element to be insert more than once, but this is what is happening for me. My question is, what function does it use...
8
by: Rakesh | last post by:
Hi - What is wrong this implementation? I get a core dump at the free() statement? Thanks Rakesh #include <ext/hash_map> #include <iostream.h> #include <ext/hash_set>
5
by: Amit Bhatia | last post by:
Hi, I was wondering if I have a hash_set, can I modify its elements using an iterator: given the fact that the changes I make will not change the position or the key of the object that the...
5
by: Markus Dehmann | last post by:
Do I have to handle hash collisions in a hash_set myself? I did a test in which I use find() to look for objects in a hash_set. These objects are definitely not contained, but find() sometimes...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.