views:

42

answers:

1

I am trying to compile something that uses Google's sparsehash include files.

libs/include/google/dense_hash_map:93:60: error: ext/hash_fun.h: No such file or directory
^Cmake: *** [all] Interrupt

I know that hash_fun.h exists in /usr/include/c++/4.3/backward/hash_fun.h. I am just not sure how to make google sparse hash use it. Any idea? I would really like to avoid tempering with either the google files or the /usr/include files. I had already to use -Wno-deprecated for removing an error about using an old STL include file, but I am pretty sure there is a way to get #include be recognized when using newer versions of STL.

A: 

When you compiled sparsehash, did you build it with the same compiler that you are using now? When I build it, it finds hash_fun in tr1/functional, not in ext/hash_fun.h.

In m4/stl_hash_fun.m4, you can see the list of places that it searches.

sharth
sparsehash is a template library, I never needed to compile it separately from the current code, so I am using the same compiler for both sparsehash and what I am using now.
stler
When I downloaded sparsehash from [here](http://code.google.com/p/google-sparsehash), the download included a configure script that figured out where the #include for hash_fun should be. You might look to see if there is a config.h in sparsehash, and look at what HASH_FUN_H is set to.
sharth
You are absolutely right. Thanks.
stler