The code works fine for me. It even compiles for you. Other than that, it's likely some part of your set up that is incorrect. I'm using Dev-C++, which is free online, you could download that and see if it works there.
What are the five LINK errors that you get? Is it the undefined symbol error five times?