hash_map blues

hash_map blues

Hi! A long-time user of the GNU C++ compiler, I decided to give the new IA32 v. 7.0 a shot. I am using Linux. Unfortunately, the way Intel implements the is different from GNU, and I don't know how to change my code.

I am enclosing a simple test program which creates a hash_map mapping a pair of strings to an int. The program compiles and runs correctly under G++, but results in 714 lines of error messages from IA32. Can you please take a look and let me know how to change it so it compiles under IA32?

Joseph Friedman

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


Documentation for the Intel C++ Compiler for Linux* STL implementation can be found at http://dinkumware.com/. Go to "Dinkum References" and then to "C++ Library Reference". That should get you going in the right direction.

Brandon H.
Intel Developer Support

For on-line assistance: http://support.intel.com/support/performancetools
For user forums: http://intel.com/ids/community
For product support information: http://www.intel.com/software/products/support
* Intel and Pentium are registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries
* Other names and brands may be claimed as the property of others

Thanks for the info. I got it to compile now. I suppose as an added bonus, my code can now compile under VC++ (not that I would ever consider doing development on a Windows platform...)


I am also having the same problems with the Intel/Dinkumware version of the STL hash_map class. I have followed the instructions from dinkumware, and get the following problem:

opt/intel_cc_80/include/c++/xhash(109): error: no suitable conversion function from "const BBDepKey" to "size_t={unsigned int}" exists
ldiv_t _Qrem = ldiv((size_t)_Keyval, 127773);

BBDepKey is a custom class that I am attempting to use as the key to the hash table. I have the following code to handle the hashing of this object:

template () struct hash (BBDepKey )
{size_t operator()(const BBDepKey& b) const{ return b.firstkey*b.secondkey*b.thirdkey; }};

(please change the "(" and ")" to brackets, (the intel boards think it's html and prohibit it)

This code is used inside the following template to handle both GCC and ICC complilers:

Please advise on how to solve this error. I have a case open with Intel preimer support for 18 days and they have not figured it out yet.


Sorry, i forgot to include the cross compiler mapping that I am attempting to use:

See attached file

With the 8.0 version of the Intel Compiler for Linux, you can use either the Intel supplied C++ libraries or use the g++ libstdc++ libraries & header files, for g++ 3.2.x(Note g++ 2.9? doesn't work) when you use the -cxxlib-gcc switch. This will use the g++ version of STL hash function. We have updated our compatibility white paper that has examples of using this at

The root cause of the hash problem is that hash isn't part of the ANSI C++ standard, and is vendor specific which is why their different implementation from different vendors.

John O'Neill

Leave a Comment

Please sign in to add a comment. Not a member? Join today