If you read the error carefully, it is saying that this line:
list<HashedObj>::iterator li;
Should read as:
typename list<HashedObj>::iterator li;
Basically, the you need to tell the compiler that you are dealing with a type. See this question or this question for more details on what is going on.
You might have other errors, but you need to resolve these first.