stler stler - 28 days ago 17
C++ Question

How to turn on STL backward compatability?

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 tampering 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.

Answer

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.