Introduce the hash_set and hash_map header files in Windows and Linux
Recommended usage:Write the code before the source code:
// Just for "# include # If _ gnuc __> 2
# Include <EXT/hash_set>
# Include <EXT/hash_map>
Using namespace _ gnu_cxx;
# Else
# Include # Include Using namespace stdext;
# Endif
Other explanations and methods:
Because hash_map did not belong to the standard library before, but was introduced later.
Therefore, you need to useStlportAnd add additional library path to setting.
When GCC is used in Linux,
One is that it is stored in the stdext namespace, so we need to use using namespace stdext to introduce the namespace and # include
Another possibility is that it is placed under the ext directory of the standard library. In this case, you still need to use the STD namespace. In this case, your source file should be # include <EXT/hash_map>;
If you do not know which one is used, you need to check and switch to the C ++ library directory:
CD/usr/include/C ++/4 .*.* |
Then run the grep command:
View the header file of hash_map.
After finding it, you can see the namespace in which it is included.