Hash function c++
-
Dear all: I am trying to use the hash_map in C++ in VS2005.NET. The code is like:
#include ... ... hash H; size_t h = H("ca");
I want to generate the hash value for the string. This code works perfectly in Linux but in VS2005 it complains that: 1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(54) : error C2065: 'hash' : undeclared identifier 1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(55) : error C3861: 'H': identifier not found It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please? ThanksAsura
-
Dear all: I am trying to use the hash_map in C++ in VS2005.NET. The code is like:
#include ... ... hash H; size_t h = H("ca");
I want to generate the hash value for the string. This code works perfectly in Linux but in VS2005 it complains that: 1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(54) : error C2065: 'hash' : undeclared identifier 1>d:\project\vs2005\c++\gmesh\gmesh\ml_geodesic_gridpoint_index.cpp(55) : error C3861: 'H': identifier not found It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please? ThanksAsura
Ming Luo wrote:
It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Does the
hash_map
file exist? Can the compiler find it? If you right-click the#include
statement, can you opt to open the file?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Ming Luo wrote:
It seems that the compiler can't find the hash definition. Does anyone have idea to solve this problem for me please?
Does the
hash_map
file exist? Can the compiler find it? If you right-click the#include
statement, can you opt to open the file?"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
DavidCrow wrote:
Does the hash_map file exist?
Indeed it exists (at least on my system, VS2005). On the other there's no hope to find the
hash
class itself (again, on my system). :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
[my articles]