EDIT: Ok, this is really weird. I included those links in my first post, but for some reason the forum software just didn't bother posting them. It's as if, it ignored those links completely and went ahead with everything after the [ / code ] tag. What gives?
You're not the only one. Welcome to the wonderful world of the IP.Board text/post editor! Basically, it sucks, and it will make you angry.
Anyway, I'm not going to rant here...
That error is complaining that the variable HEAD doesn't exist. And indeed it doesn't. The name of the variable is Head (look carefully at the STACK class), not HEAD (and yes, C++ is case sensitive).