我正在尝试编译一些使用 Google 的 sparsehash 包含文件的东西。
libs/include/google/dense_hash_map:93:60: error: ext/hash_fun.h: No such file or directory
^Cmake: *** [all] Interrupt
我知道 hash_fun.h 存在于/usr/include/c++/4.3/backward/hash_fun.h 中。 我只是不确定如何让 google sparse hash 使用它。任何想法?我真的很想避免篡改 google 文件或/usr/include 文件。我已经使用 -Wno-deprecated 来消除有关使用旧 STL 包含文件的错误,但我很确定有一种方法可以在使用较新版本的 STL 时识别#include。
最佳答案
当您编译 sparsehash 时,您是否使用与现在相同的编译器构建它?当我构建它时,它会在 tr1/functional
中找到 hash_fun,而不是在 ext/hash_fun.h
中。
在 m4/STL_hash_fun.m4
中,您可以看到它搜索的位置列表。
关于c++ - 如何开启STL向后兼容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4029801/