I have some custom classes: LocationInfo (information about a location), and Coordinates (two ints specifying an X & Y grid location). I'm using an unordered_map to key a Coordinates object to a vector of LocationInfo objects:
typedef std::vector<LocationInfo> LocationVector;
...
std::unordered_map<Coordinates, LocationVector> data;
// I also tried:
// std::unordered_map<Coordinates, std::vector<LocationInfo> > data;
Upon linking, I get a very long error (two actually) that ends with:
undefined reference to `std::hash<Coordinates>::operator()(Coordinates) const'
I'm using g++4.6.1 with the -std=c++0x option on Ubuntu 11.10. After reading some posts on here, I originally thought there might be an issue requiring me to explicitly use typename before one of the types in the declaration. But I've only seen a need for that when using templates that confuse the compiler. I added some in just in case, and that only made matters worse.