c++ - Cannot find hash_map header under Mac OSX -


#include <iostream> #include <vector> #include <list>  #ifdef __gnuc__ #include <ext/hash_map> #else #include <hash_map> #endif 

the compiler says " hash_map: no such file or directory " need help. thank you.

on macosx correct header @ <ext/hash_map> not <hash_map>. here worked fine:

#if defined __gnuc__ || defined __apple__ #include <ext/hash_map> #else #include <hash_map> #endif  int main() {         using namespace __gnu_cxx;          hash_map<int, int> map; } 

by way, prefer use <tr1/unordered_map>.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -